Skip to content

Instantly share code, notes, and snippets.

@kriskhaira
Created November 7, 2011 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kriskhaira/1344556 to your computer and use it in GitHub Desktop.
Save kriskhaira/1344556 to your computer and use it in GitHub Desktop.
To redirect all users to access the site WITHOUT the 'www.' prefix
# NO WWW - taken from Drupal 7's .htaccess
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# --------------------------------------------------------------------------------------------------
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment