Server Fault is a question and answer site for system and network administrators. 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

I use IIS7. how do i config it so that if the user types it redirects to like on this site?

share|improve this question
up vote 6 down vote accepted

There are 2 good ways to do this in IIS7. URL Rewrite is great if you have it installed. With that you can create a rule to redirect www to non-www. Another option is the HTTP Redirect feature in IIS.

To use the IIS HTTP Redirect (easiest method), do the following:

  • create a 2nd site with a host header binding of
  • BE SURE to point it to a different path on disk since in IIS Manager updating the HTTP Redirect will update your web.config file which you don't want to update for your main site. Just point to a deadend folder since it isn't used for anything else for reading the web.config file.
  • For your www site, turn on the HTTP Redirect and set the value to Set the status code to 301 (permanent)
share|improve this answer
@Scott: Thanks for the insight. i thought host headers and the appropriate DNS records were all that was required. Thanks for clearing it up for me. – joeqwerty Nov 25 '09 at 3:53
@joeqwerty. Often times it is all that is needed. People don't usually mind having 2 domains (with and without www) pointing to the same site. It's getting more common now for people to ensure that only 1 domain name points to their site search engine positioning (SEO) reasons. – Scott Forsyth - MVP Nov 25 '09 at 4:15
@Scott: well then i learned something new today... ;) – joeqwerty Nov 25 '09 at 4:29

huh? do you mean that if the user types or that it goes to the same web site? if so, then you need to do two things:

  1. make sure your domain A record points to the ip address of the web server. make sure your www record points to the ip address of the web server (obviously).

  2. add host headers to the web site in iis7 for both url's. you'll want to add and as host headers on the web site.

share|improve this answer
type it goes to but type it stays – newBEE Nov 25 '09 at 2:53

Easiest solution is you can add bindings to domain. In iis select your site and in right pane in bindings section add binding;

share|improve this answer

Your Answer


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