Skip to content

Instantly share code, notes, and snippets.

@brandonhimpfen
Created December 1, 2013 01:00
Show Gist options
  • Save brandonhimpfen/7727333 to your computer and use it in GitHub Desktop.
Save brandonhimpfen/7727333 to your computer and use it in GitHub Desktop.
Remove the WWW from the Beginning of the URL
# Rewrite www.example.com → example.com
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment