How To Force Apache To Use www In The Domain Name

Author: , April 19th, 2011

1 2 3 4 RewriteEngine On RewriteCond %{HTTP_HOST} !^www.YourDomain.com RewriteCond %{HTTP_HOST} !^$ RewriteRule ^.*$ http://www.YourDomain.com%{REQUEST_URI} [R=301,L] RewriteEngine On RewriteCond %{HTTP_HOST} !^www.YourDomain.com RewriteCond %{HTTP_HOST} !^$ RewriteRule ^.*$ http://www.YourDomain.com%{REQUEST_URI} [R=301,L]