Return to Snippet

Revision: 35124
at November 3, 2010 02:03 by jfine


Initial Code
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]

Initial URL


Initial Description
I like using HTTP_HOST with a simple regex so it'll work in multiple environments, ie stage, production, dev, etc.

Initial Title
Redirect www to non-www with a 301

Initial Tags


Initial Language
Apache