Skip to content

Instantly share code, notes, and snippets.

@zuf
Created July 26, 2011 12:43
Show Gist options
  • Select an option

  • Save zuf/1106666 to your computer and use it in GitHub Desktop.

Select an option

Save zuf/1106666 to your computer and use it in GitHub Desktop.
www to non-www redirect (mod_rewrite)
RewriteEngine On
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