I just discovered my years old blog at my website www.AcmeAims.com which I plan to use for Self Development and Motivational Stuff when I will be free from my business projects.
There I had a blog about Website traffic which i decided to transfer to www.FreeInstantTraffic.com/blog . I wanted to preserve all URLS to posts intact as old blog was indexed in Google and other search engines deep and many users were coming there.
Using the built in function of Import and Export of WordPress i imported all content to new blog. But I was concerned about the URLs structure as I want the incoming users from SEs to go directly to right post without error.
The htaccess file did the magic. I just added one line at my previous blog’s .htaccess file and I am done. Everything was taken care by .htaccess file and every old link is pointing to right link to new blog. For example this was post old blog: http://www.acmeaims.com/website-traffic/seo-wordpress-and-keywords-in-url.html … You see this redirect to new Blog’s correct post flawlessly.
Ok how you can implement this too with your old blog’s .htaccess file:
Open you .htaccess file and implement this line of code as shown:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /website-traffic/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /website-traffic/index.php [L]
Redirect 301 /website-traffic/ http://freeinstanttraffic.com/blog/
</IfModule># END WordPress
In above .htaccess file the RED line was added.. where as /website-traffic/ is folder in old domain and http://www.freeinstanttraffic.com/blog is link to new blog.
If your previous blog was at root domain.. it could have been like this:
Redirect 301 / http://www.freeinstanttraffic.com/blog/
Note: I had to set the same Permalink structure for new blog as it was for previous to make this work right.