Moving WordPress and 301 Redirect
I was a little nervous, especially sense I’ve never been officially trained in any programming, but I was able to move my blog from http://www.willeitner.org/blog to http://www.willeitner.org/ without any problems. The real victory was modifying my .htaccess file to perform the 301 redirect from all of the old URLs to the new ones. Even though my blog doesn’t have tons of “Google juice”, being that it isn’t very old, I still didn’t want it to lose the search traffic that it is already getting. With that in mind, I wanted to be sure to implement a redirect so that I wasn’t returning any 404 errors. If you wanted to do the same thing then here is the old .htaccess file:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
And here’s the new one:
RewriteRule ^blog(.*) $1 [R=301,L]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
The moment that made me the most nervous was after step 6 in the instructions that Wordpress provides for moving a blog. Once I hit Update I got a Page Not Found page. However, after copying the files from the /blog/ directory over to the root I fired it up and it worked fine.
Now all I got to do is set up my analytics so that I can track referring sites through the redirect.
digg
del.icio.us
RSS
FeedBurner