I recently shifted the content management for my blog (www.sindark.com) from Blogger to WordPress. I shifted the Blogger version into a sub-directory, so that people who prefer to access old posts in that format can. Now, I want to use htaccess to automatically redirect people who try to access the Blogger archives in the old location. I want them sent to the Blogger files in the new location.
The old static HTML Blogger files were kept in three directories:
www.sindark.com/2005/
www.sindark.com/2006/
www.sindark.com/archive/
The new equivalents are:
www.sindark.com/blogger/2005/
www.sindark.com/blogger/2006/
www.sindark.com/blogger/archive/
The big problem is this: WordPress also uses www.sindark.com/2005/ and www.sindark.com/2006/ as directories, though it doesn't actually put any files in them. Because of that, the code I tried below doesn't work. It does redirect people properly for the Blogger pages, but it breaks WordPress:
Redirect 301 /archive http://www.sindark.com/blogger/archive/
Redirect 301 /2005 http://www.sindark.com/blogger/2005/
Redirect 301 /2006 http://www.sindark.com/blogger/2005/
Since all the Blogger files are .html and all the WordPress files are .php, there may be some way to redirect requests for HTML pages in those directory to the new Blogger area, while leaving .php requests alone.
Right now, there are two copies of all Blogger content: one at the new location and a residual copy in the old location. Having it there doesn't bother WordPress, but I would really prefer to have all the Blogger stuff off in its own section: hence the need for this redirection.
If anyone knows how to code that, or can suggest a better approach, I would be most appreciative. The major reason I want to do this is that the old Blogger pages have all been listed on Google and get frequent hits through there. I don't want people to start getting 404 errors instead.
This issue is also being discussed at: http://www.sindark.com/2006/05/21/bug-reports-thread/
This is untested/probably error ridden/etc, but should get you on the right track. What it is supposed to do is match any URL that ends with .html, and rewrite the URL to /blogger/2005/whatever_was_matched.html . The [R] should then force them to refresh the page.
posted by team lowkey at 12:58 PM on May 23, 2006