Enforce www on domain names

There are many samples around this. But I find the following one if you’re parking many domains on the same hosting…

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

A very useful tutorial around .htaccess I found is here.

One thought on “Enforce www on domain names”

Leave a Reply

Your email address will not be published. Required fields are marked *