Skip to content

Instantly share code, notes, and snippets.

@lukemorton
Created November 9, 2010 15:57
Show Gist options
  • Save lukemorton/669274 to your computer and use it in GitHub Desktop.
Save lukemorton/669274 to your computer and use it in GitHub Desktop.
Get ride of www, put this in your htdocs (or public_html) directory
# Some rewriting
RewriteEngine On
# Force remove www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment