Force users to use the WWW or Non-WWW version of your domain

Force users to use http://www.yoursite.com

To force users to use the www version of your domain all you have to do is add the following code to your .htaccess file (just replace yoursite.com with your domain name).

Alternatively you can use :

 

 

Force users to use http://yoursite.com

To force users to use the non www version of your domain all you have to do is add the following code to your .htaccess file (just replace yoursite.com with your domain name).

Alternatively you can use :

 

 

 


Source: http://www.htaccessbasics.com/force-www-nonwww-domain/

Leave a Reply

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