Return to Snippet

Revision: 35123
at November 3, 2010 02:01 by jfine

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

Initial URL

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

Initial Title
Redirect non-www to www with a 301

Initial Tags

Initial Language