views:

53

answers:

2

I have a website that has a number of URLs that people use to connect to that site (uses the bindings on the IIS website and everything works as intended):

Now what I want to do is have all of the URLs go to https://www.sample.com - so if you type in "http://xyz.sample.com" or "sample.com" you should go to https://www.sample.com

The question is what is the best mechanism to do this? I have one possible solution (which I will put as an answer to this question), but I get the feeling that there might be another, better solution available.

A: 

Set up a new website on the new binding https://www.sample.com, and then, on the old website, open the Http Redirect property page and set up your redirect.

That's in IIS Manager.

Andras Zoltan
A: 

One possible option via IIS settings would be to do the following:

  1. Remove extra site bindings from website (i.e. xyz.sample.com, sample.com, etc...). This should leave just the web url you are trying to get all traffic to flow to (i.e. https://www.sample.com)
  2. Create a second website in IIS
  3. In the second website create bindings that were removed from the original website
  4. In the second website use the HTTP Redirect (option in IIS) to direct all traffic from the second site (where all the alternate urls now reside) to the goal site (https://www.sample.com)
ChrisHDog