To always redirect users to the www site (for example: http://dotboost.com to http://www.dotboost.com), add the following lines to .htaccess, right after RewriteEngine On:

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


If, on the other hand, you want to redirect http://www.dotboost.com to http://dotboost.com, add the following lines instead:

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

Replace dotboost.com with your site’s domain.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>