Skip to content

Instantly share code, notes, and snippets.

@trey
Created September 10, 2008 04:32
Show Gist options
  • Save trey/9823 to your computer and use it in GitHub Desktop.
Save trey/9823 to your computer and use it in GitHub Desktop.
No WWW
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
RewriteEngine On
# No WWW
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com$1 [R=301,L]
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment