You can redirect or change all of the user requests for your domain to www or non-www by changing your website’s .htaccess file.

you have to create a htaccess (htaccess is a configuration file for use on web servers running the Apache Web Server ) file on your root directory of your website or portal.




How to redirect your domain to www :

=>you have to add below line in the top of  .htaccess file.As reference I have taken my website domain(websnube.com).

Above script will change http://websnube.com  ==>  http://www.websnube.com automatically.

So when someone access http://websnube.com the visitor will be redirected to http://www.websnube.com.

How to redirect your www domain to non-www :

=>you have to add below line in the top of  .htaccess file.As reference I have taken my website domain(websnube.com).

Above script will change http://www.websnube.com  ==>  http://websnube.com automatically.

So when someone access http://www.websnube.com the visitor will be redirected to http://websnube.com.

That’s it.