Need To Redirect Old WordPress Post Using htaccess?

I had to do this recently to one of my blog sites. Simply add this to your .htaccess file for every post your want redireceted. Easy stuff.

redirect 301 /2006/12/18/postname/ http://www.example.com/category/postname/

Here the old post URL,
http://www.example.com/2006/12/18/postname/

will be redirected to new URL,
http://www.example.com/category/postname/

Note that in the definition, first part is the old URL without domain name and the second part is complete new URL. Keep whole definition in one line (Don’t include line brakes using Enter button). Also note where to apply spaces (There is a space between old URL and new URL).

Easy stuff I know, but this text file was taking up space on my desktop and I needed to get rid of it. Why not add it to the blog for me and you later and trash the text file. Cheers!

Donald

Donald

Creator of SFB, eBay Stealth and Amazon Ghost at aspkin

¯\_(oo)_/¯ My Recent Works –> eBay Stealth, Amazon Ghost, AutoBlogBook, SixFigureBoss

Donald

Are you using Kodi? I gave it a shot and I’m loving it! Though, using it without a VPN can be dangerious…… https://t.co/oiDqFUXmXk – 4 months ago

Donald

Donald

Latest posts by Donald (see all)

Posted on by Donald in SEO

Leave a Reply

Be the First to Comment!

avatar
wpDiscuz