Skip to content

Instantly share code, notes, and snippets.

@douglasmiranda
Created July 5, 2011 17:05
Show Gist options
  • Save douglasmiranda/1065288 to your computer and use it in GitHub Desktop.
Save douglasmiranda/1065288 to your computer and use it in GitHub Desktop.
Remove www in url (.htaccess snnipet)
#Paste in your .htaccess file, and the requests www.yoursite.com will be redirected to http://yoursite.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !^yoursite.com$ [NC]
RewriteRule ^(.*)$ http://yoursite.com/$1 [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment