Redirect a www prefixed site to a non-www prefix
July 10th, 2007I like clean URLs.
Add this to your .htaccess in the site root
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^DOMAIN\.com
RewriteRule (.*) http://DOMAIN.com/$1 [R=301,L]
| Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo |
Was this post useful to you? Let me know, buy me a beer!
Alternatively, if you're feeling impecunious, you may like to subscribe to my RSS feed, or see other articles in the Geekery category.