Recently I have made good use of the Apache .htaccess file to redirect and rewrite URL’s to keep visitors from getting page not found errors. Moving three domains, creating a subdomain or two, and then moving things around again, has created ample opportunity for lost visitors.
There are lots and lots of pages in the Google search results for “.htaccess,” so here are my notes, all in one place, for your reading pleasure.
Redirect visitors from an old site to a new site
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !www.newsite.com$ [NC]
RewriteRule ^(.*)$ http://www.newsite.com/$1 [L,R=301]Redirect visitors using .html links to .php links
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !newdomain.com$ [NC]
RewriteRule ^(.*)\.html$ http://newdomain.com/$1\.php [L,R=301]
RewriteRule ^(.*)\.php$ http://newdomain.com/$1\.php [L,R=301]
RewriteRule ^(.*)$ http://newdomain.com/ [L,R=301]
Let the drooling begin. Apple Macbook Air.
I’ve fiddled around with the header image, finally getting the original image in its entirety once again. The cropped image was nice enough, but I prefer the one I’ve had for most of the past decade. The image is a slice of an old Corel wallpaper called Autumn Coast, which I’ve misplaced. If any of you still has a circa 1997 Corel images CD, let me know in the comments.
There is also the beginnings of a true colophon page, which is details about how the site is published, the fonts used, and other nerdy tidbits.