Skip to content

Instantly share code, notes, and snippets.

@akanik
Last active February 2, 2016 20:34
Show Gist options
  • Save akanik/3d1d2bb7006b823f0c38 to your computer and use it in GitHub Desktop.
Save akanik/3d1d2bb7006b823f0c38 to your computer and use it in GitHub Desktop.
.htaccess redirect www
# To redirect all users to access the site WITHOUT the 'www.' prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# Make sure to replace example.com with your own site name
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment