Feeds, Redirects, & Htaccess
(or how not to lose your feed readers when you move to WordPress)
Was your blog previously at http://yourblog.blogspot.com?
Then you have it easy! Go to your Blogger dashboard and set your blog address as your new WordPress blog URL. Then, find the feed settings in your Blogger dashboard, and tell Blogger to redirect your feeds to your new feed address (if you were already using FeedBurner before you switched, then just leave your FeedBurner address in Blogger’s feed redirect). (To redirect all your old Blogspot permalinks, use this plugin and its accompanying directions for a javascript redirect in your Blogger header.)
Were you already publishing your blog to your own domain before you switched from Blogger to WordPress?
Then you get to use .htaccess! All you need to redirect your feeds is two simple lines:
Redirect 301 /feeds/posts/default http://feeds2.feedburner.com/yourfeed
Redirect 301 /feeds/comments/default http://yoursite.com/comments/feed/
But you can do a lot more than just keep your feed readers–you can keep your old permalinks active, redirect your archive & label pages, and lots more! Read on to find out all the things I did with the .htaccess file redirects when I migrated from Blogger to WordPress:
- Unlike most sites that talked about moving to WordPress, I wanted to keep my month/year permalinks (and thus I set my permalinks settings in WordPress to the custom setting of /%year%/%monthnum%/%postname%/ as directed here) just as I had in Blogger, and have my Blogger permalinks redirect to the same post on WordPress. So again, I used the great plugin (an install, activate, delete kind of thing) to take care of truncating and eliminating the articles out of the Blogger-originated post permalinks, and then the only thing I had to worry about was trimming off the .html and adding a slash.
http://blog.ylcf.org/2008/04/my-last-blogger-post.html to http://ylcf.org/2008/04/my-last-blogger-post/ - I wanted my old label pages from Blogger to redirect to the appropriate tag pages on WordPress (but if you are going to use categories with hierarchies, it’s probably easier to do line-by-line redirects in .htaccess, which is what I ended up doing–see example below).
http://blog.ylcf.org/search/label/poetry to http://ylcf.org/tag/poetry/ - I wanted my old archive pages from Blogger to redirect to WordPress archive pages
http://blog.ylcf.org/2008_07_01_archive.html to http://ylcf.org/2008/07/ - And most importantly, I wanted to redirect my Blogger feed to my WordPress/Feedburner feed seamlessly–the new posts from WordPress showing up in their feed readers, just like always
http://blog.ylcf.org/feeds/posts/default to http://ylcf.org/feed or http://feeds2.feedburner.com/ylcf
(Remember, if you’ve been using BlogSpot, you can’t redirect your feed via .htaccess–you’ll have to put your new feed address in your Blogger feed settings. If you were using both BlogSpot and FeedBurner, you’re all set–just remember to update your FeedBurner original feed settings and install and set up a FeedBurner plugin in WordPress.)
For the first three, I used Apache mod_rewrites (which I don’t know how to write, so I used what I found here and rewrote what I found here). For the feed, a simple redirect worked. (Remember, my subdomain forwarding was already taking care of sending blog.ylcf.org to ylcf.org, so I was only worried about what came after ylcf.org/.)
Here’s what to place in your .htaccess file. These exact lines, nothing more or less (unless you’re an htaccess pro and already had your own htaccess file), except for changing “yoursite.com” and “yourfeed” to your actual site and feed address, of course:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)\.html$ $1/$2/$3/ [QSA,R=301,L]
RewriteRule ^search/label/[a-z0-9]$ tag/$1/ [QSA,R,L]
RewriteRule ^([0-9]{4})_([0-9]{1,2})_([0-9]{1,2})_archive.html$ $1/$2/ [QSA,R,L]
</IfModule>
Redirect 301 /feeds/posts/default http://feeds2.feedburner.com/yourfeed
Redirect 301 /feeds/comments/default http://yoursite.com/comments/feed/
The rewrites are in order of the list above. And no, I don’t understand how it all works–I didn’t particularly care for Algebra. There are Apache mod_rewrite cheat sheets all over the internet if you feel the need to change something. But these do work, if you’re sticking with the permalink structure that looks just like Blogger.
If you switched all your Blogger labels to WordPress categories, instead of the tags they automatically import as, you’ll probably want to eliminate that second rewrite rule and redirect your labels to categories line by line (unless you don’t take advantage of category hierarchies–in that case, just change the word tag in that rewrite rule to category, and you’re set). Here are some examples of label to category redirects:
Redirect 301 /search/label/poetry http://yoursite.com/category/read/poetry/
Redirect 301 /search/label/quotations http://yoursite.com/category/read/quotations/
Redirect 301 /search/label/waiting http://yoursite.com/category/wait/


























