【发布时间】:2019-08-23 09:17:38
【问题描述】:
我正在寻找将多个 URL 重定向到一个新 URL 的最佳方法。 我有以下网址:
我希望那些重定向到:https://application.domain.app.company.com 解决这个问题的最佳方法是什么(在 IIS 中)?
我尝试过使用 URL 重写,但我只能使第一个 URL (https://domain.app.company.com/application) 起作用:
<rule name="Application 1" patternSyntax="Wildcard" stopProcessing="true">
<match url="*application" />
<action type="Redirect" url="https://application.domain.app.company.com" appendQueryString="false" />
</rule>
对于第二个 URL (https://application.app.company.com),我可以在 IIS 中设置一个新的(空的)网站(侦听该 URL)并在其中添加一个 httpRedirect 时使其工作。
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="https://application.domain.app.company.com" exactDestination="true" httpResponseStatus="Permanent" />
</system.webServer>
</configuration>
这是推荐的解决方法吗?还是有别的办法?
谢谢
Schoof
【问题讨论】:
标签: redirect iis url-rewriting