M/s Business Configuration Online
61, Sultanpur Dabas, Delhi 110039, India.
Email: info@internetmarketing.technology
Ph.: (+91)-99539-30359.
(Regd. by Govt. of India)

Redirecting www to non-www


SEO

To avoid duplicate content in search engines you can force users to use either the www or the non-www version of your website domain.

Redirecting www to non-www and reverse (solved)

If you want to redirect all non-www requests to your site to the www version, add the following code to your .htaccess file:

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

Adversely
Redirecting www to non-www
If you want to do the opposite, use the following code:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^my-domain\.com$ [NC]
RewriteRule ^(.*)$ http://my-domain.com/$1 [R=301,L]

Have any Question or Comment?

Leave a Reply