Skip to content

Instantly share code, notes, and snippets.

@tan3
Last active November 10, 2015 14:44
Show Gist options
  • Save tan3/9681769 to your computer and use it in GitHub Desktop.
Save tan3/9681769 to your computer and use it in GitHub Desktop.
htaccess: redirect www to non-www
# redirect www to non-www
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1$1 [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment