Happy New Year

I went to bed at 11pm last night, and got up at 6:30 today, so I can’t say I had a wild & crazy New Year’s Eve. That’s OK though.
Early in the year, I often find a few things that I’ve been putting off for too long, and try to take care of them. This morning’s project has been getting redirects in place on this web site, so that links to my old blog entries, from back when I was using Blogger’s old FTP publishing, to andrewhuey.org, will do 301 redirects to the appropriate pages at blog.andrewhuey.com, where the pages are now dynamically generated by Blogger.
I switched from FTP to “custom domain” back in Feb 2010, so I’ve put off the redirect stuff for long enough that it probably doesn’t matter anymore. But it seems like a good idea anyway.
I don’t know that much about .htaccess files and ModRewrite, but I know just enough to be dangerous. I picked up some hints on what I need to do here and here.
The part of my .htaccess file that handles redirection now looks like this:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST}   !^files.andrewhuey.com [NC]
RewriteRule (.*) http://blog.andrewhuey.com/$1 [R=301,L]

I use files.andrewhuey.com to reference various files on my web server. Everything else should just get redirected to blog.andrewhuey.com. So, pretty simple.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.