Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I set the non-www url to redirect to www format.

Please guide me - if I do it through server control panel, the site doesn't work.

share|improve this question

Google turned up a bunch of tutorials for this. This one and this one looks as good as any.

share|improve this answer


I used this site to 301 my site, though mines an Apache server, it has an ISS walk-through also.

Or visit this link: http://www.windowshostingasp.net/windows_hosting_forums/showthread.php?t=35

Login in your windows server and start IIS console.

Now choose the server running the site you want to forward. Remember that you need 2 sites - one to forward from and one to forward to. These can be on the same or separate servers.

Right click on the site you want to redirect from and choose Properties - Home Directory.

The default is the first choice, "A directory located on this computer". Change it to "A redirection to a URL" and type in the new URL.

If you want it to be a 301, then be sure to check ON the choice for “A permanent redirection for this resource”. If you want it to be a 302, leave the choice checked OFF. If you want to pass on some variables, for example, you wanted to redirect an ASP.NET site that accepted arguments for some pages and pass those same arguments on to the same pages at the new site.

In this case, in the "Redirect to:" box, enter the domain you wish to move to (no trailing slash), plus $S$Q.

By example: http://www.seconddomain.com$S$Q

Next, check the options that state the client will be sent to "The exact URL entered above", as well as "A permanent redirection for this resource" (if you want it to be a 301).

$S$Q are tags that IIS will automatically replace - $S will be replaced with the subdirectory location (such as “/modules/store.aspx”) and $Q will be replaced with the query string (such as “?id=1”). "

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.