Redirect Subdomain URL to another SubDomain in IIS

后端 未结 2 1779
情书的邮戳
情书的邮戳 2021-02-15 15:37

I need to redirect a \"fake\" sub domain to a real subdomain in IIS 7.5. The reason is that the marketing department doesn\'t want to use the actual website address in print pie

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-15 16:11

    I think you need to create a separate site with host bindings for report.usapartners.com (the fake site) in IIS. This is going to be a stub site (it will still need a path on the disk, but it's only going to have a web.config in there) which will just host a redirect rule.

    Now click on HTTP Redirect for that site in IIS and tick Redirect requests to this destination and put http://reporting.usapartners.com in the textbox. Then tick Redirect all requests to exact destination (instead of relative to destination), don’t tick the next one and then choose Status Code Permanent (301).

    If you want it to redirect and keep the subdirectories and/or query string, then you can change the contents of the textbox to be http://reporting.usapartners.com$S$Q. Note that there is no trailing slash in this case. The $S preserves the sub directories and the $Q preserves the query string.

提交回复
热议问题