How to change your wordpress directory URL and redirect the traffic (.htaccess, 301 redirect, permalinks)

I’ve been planning to move my wordpress blog (this one actually) from it’s old URL- http://turcanu.net/blog , to a subdomain within the same domain name – http://sergiu.turcanu.net for a long time now, and finally I did the transfer today which went all smooth and fine, although I thought it would require some additional hacks inside the .htaccess file. The thing is, I also wanted to get rid of my old long permalinks that included the year, month and date along with the post title, and get them to display just the post title. So, what used to look like this: http://turcanu.net/blog/2006/11/05/on-the-train-to-lhasa/ now is changed and shorten to: http://sergiu.turcanu.net/on-the-train-to-lhasa/

I’ll try and do a quick tutorial on how to apply this changes and still retain the traffic from the old URL’s through 301 redirects applied in the .htaccess file. In case you’re not aware – 301 redirects in .htaccess are also considered the best way to tell search engines that your page moved permanently, which is good for your SEO. This tutorial is also good for when switching to a new domain name.

Read moreHow to change your wordpress directory URL and redirect the traffic (.htaccess, 301 redirect, permalinks)