Geek & Mild by Sean Sperte
Removing “www” From a Domain
Here’s what I do to remove “www” from my domain. I put this code in my .htaccess file:
- RewriteEngine On
- #Handle removal of “www”
- RewriteCond %{HTTP_HOST} ^www.YOURDOMAIN.com(.*)$ [NC]
- RewriteRule ^(.*)$ http://YOURDOMAIN.com/$1 [R=301,L]
A couple quick notes about this method if you want to use it as your own:
- In order to see/edit .htaccess, you may have to show “invisible” files in your FTP application.
- This only works on servers running Apache.
For more information, and a technical explanation of what each line does, read John Gruber’s post (and subsequent opinion of why one would want to do this) from May 2006.
25-Mar 2007
© 2012 Sean Sperte, please don't steal. More info.
Handcrafted using Espresso, powered by ExpressionEngine.