301 Redirect in Action
Posted by Aaron on 02 Oct 2006 at 12:53 pm
On Friday I upgraded this blog to the latest version of WordPress (2.0.4); hopefully I didn’t screw anything up too bad. In the process I found that Yahoo still had a bunch of pages from my old blog indexed in its search engine. I had imported all of those posts to this blog, so they weren’t really doing much good out there.
So, I decided to use a mod_rewrite 301 to redirect traffic from the old blog to the new. I didn’t do it on a page-by-page basis since I wasn’t really getting any human traffic to the old blog, the new pages are already indexed, and I didn’t really feel like it was worth putting the time into redirecting each of the permalinks.
So, I decided just to 301 redirect every page at the old blog to the home page of the new. That way the search engines will drop the old pages and any real visitors will find the new site.
I opened up my .htaccess file in the directory where my old blog resides and added the following code to it:
RewriteEngine On RewriteRule ^blog(.*)$ http://www.aarondalrymple.com [L,R=301]
“blog” refers to the old directory name where the old blog lived. So, all traffic to that directory now forwards to www.aarondalrymple.com. To see it in action, go here: http://www.aarondassociates.com/blog/.
I should note that if your site is on a Windows server, there is a different process for this, which you should be able to find by digging around this post on redirects.
Tagged as: Search Engines, Yahoo, SEO, Blogging, Other, 301 redirect, redirects, WordPress, mod rewrite, htaccess















