Redirect IIS:重定向多个URL';s转到同一个网站
我正在寻找将多个URL重定向到一个新URL的最佳方法。 我有以下网址:Redirect IIS:重定向多个URL';s转到同一个网站,redirect,iis,url-rewriting,Redirect,Iis,Url Rewriting,我正在寻找将多个URL重定向到一个新URL的最佳方法。 我有以下网址: 我想把它们重定向到: (在IIS中)最好的方法是什么 我尝试过使用URL重写,但我只能在第一个URL()中使用: ),我可以在IIS中设置一个新的(空的)网站(侦听所述URL)并在其中添加httpRedirect时使其工作 <configuration> <system.webServer> <httpRedirect enabled="true" destin
),我可以在IIS中设置一个新的(空的)网站(侦听所述URL)并在其中添加httpRedirect时使其工作
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="https://application.domain.app.company.com" exactDestination="true" httpResponseStatus="Permanent" />
</system.webServer>
</configuration>
这是推荐的方法吗?还是会有别的办法
多谢各位
如果你想为同一个IIS网站绑定两个url,我建议你可以尝试重写下面的url。我们可以创建两个url重写规则来满足您的要求
<rule name="Application 1" patternSyntax="Wildcard" stopProcessing="true">
<match url="*application" />
<action type="Redirect" url="https://application.domain.app.company.com" appendQueryString="false" />
</rule>
<rule name="test" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="application.app.company.com" />
</conditions>
<action type="Redirect" url="https://application.domain.app.company.com" />
</rule>
我不知道为什么,但它现在似乎不起作用。当我转到(HTTPS)时,我在Chrome中得到一个“ERR\u CONNECTION\u RESET”。当我转到(HTTP)时,我会看到蓝色的IIS屏幕。有什么想法吗?看来你的网站绑定有问题。我建议您可以检查application.app.company.com(HTTP)的IIS站点绑定,以确保没有其他站点绑定到80端口。此外,我认为这是另一个问题,我建议您可以尝试发布关于您的域绑定和站点绑定的详细信息,现在为您的站点启动一个新线程。
<rule name="Application 1" patternSyntax="Wildcard" stopProcessing="true">
<match url="*application" />
<action type="Redirect" url="https://application.domain.app.company.com" appendQueryString="false" />
</rule>
<rule name="test" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="application.app.company.com" />
</conditions>
<action type="Redirect" url="https://application.domain.app.company.com" />
</rule>