301 Redirects in Apache
November 12th, 2008 by ErikTaming the Beast has a nice primer on HTTP 301 redirects. I spent some time this morning cleaning up AF-Design’s internal issues after reading over the HubSpot Website Grader report. If you manage a website and haven’t already done so - consider running the free report. It takes only a few minutes to generate and read and most problems can be fixed in only a few additional minutes. You can get a handy dynamic badge too, which you can put on your internal monitoring tools to keep tabs on things.

Website Grader Score Badge Screenshot
The real takeaway on this article for me was swapping all references of www.af-design.com to just af-design.com. WordPress was already handling this for all blog entries, but the remaining sections of the site were still being referenced with the “www.” prefix. The additional lines for the .htaccess file are provided below for reference.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.af-design.com [NC]
RewriteRule ^(.*)$ http://af-design.com/$1 [L,R=301] |
Tags: apache, htaccess, optimization, seo