How to Remain Popular When Moving Your Blog
Posted on April 1st, 2007 in Uncategorized | No Comments »
Maintaining your permalink structure when moving between blog platforms is incredibly important. When I moved one of my blogs from Movable Type to WordPress, I decided to get rid of day of the /day/ directory and the trailing .php suffix, which WP doesn’t use by default. In doing so, I wanted to make sure that links from search engines and blogs continued to work.
I moved from:
www.example.com/archives/month/day/entryname.php
to:
www.example.com/archives/month/entryname/
The easiest way to do this was with the Apache server mod_rewrite module, which is installed by most web hosts by default. Unfortunately, figuring out the mod_rewrite code to do this in my .htaccess file was tough, the learning curve is incredibly steep. I asked around forums and the WordPress support site.
Here is the code to add to you .htaccess file. You may need to adjust for your specific situation.
RewriteEngine On
RewriteBase /RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(.*)\.php$ http://example.com/archives/$1/$2/$4 [R,L]
RewriteCond %{REQUEST_URI} ^archives/.*$
RewriteCond %{REQUEST_URI} !^.+\.php.*$
RewriteRule .* – [L]
Additional mod_rewrite tips and tricks to make sure your killer Page Rank and SEO work doesn’t go down the drain when moving your blog.