English 中文(简体)
What is the recommended method of HTTP Redirection from multiple URLs to one URL?
原标题:

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.

最佳回答

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)
问题回答

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.





相关问题
session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

How to use appcmd to set debug=false in IIS7

I m trying to use APPCMD to set debug=false in web.config, per the documentation. The specific syntax I am using is: APPCMD SET CONFIG "SITE/VDIR" section:compilation /debug:False /commit:APP ...

Windows User Account that executes only IIS7 Provisions

I have a web application that executes IIS 7 provisions (using Microsoft.Web.Administration.dll) to create our web and ftp sites. When I run this using the administrator account, it works ok. I want ...

Could I get by HttpModule the URL that contains * before?

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address And I would support *...

IIS 7 Http Handler development issue

I am using VSTS 2008 + C# + .Net 3.5 + IIS 7.0 to develop an ASP.Net web site. I want to develop an Http module, which could inspect whether incoming request has some specific http header (e.g. ...

热门标签