How did i set that if someone access my website without www it should also point to www version...Also my website in not in php and supports ISS..
If you are on an Apache web server you can use the following: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.your\.com [NC] RewriteRule (.*) http://www.your.com/$1 [R=301,L] Code (markup): If you are on IIS then you may be out of luck but your host can advise.
Go to root directory and edit this with your site name instead of "your" and add them in the .htaccess which will be in your root directory If not create one and do it.
If you have IIS web server you can use following ISAPI rewrite rule: RewriteCond Host: ^domain\.com RewriteRule (.*) http\://www\.domain\.com$1 [I,RP] Code (markup): Kailash
You can use redirect code or can add .htaccess file to redirect your website to www even when you didn't type www
Thanks for the .htaccess code. I don't know why, but it only works for the root domain. I.e. when I visit my site, example.com it will change to www.example.com... which is fine. However, when I visit example.com/directory, it will not redirect to www.example.com/directory. How do I accomplish this? Thanks.