我创建了两个站点,一个在默认站点的 80 端口上,另一个在 786 端口上,现在我希望如果用户打开 url http://myurl.com/Application,它应该打开http://myurl。 com:786/应用程序。我已经安装了 IIS 7.5 重写模块。我尝试了不同方式的代码,例如
<rule name="Red" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="www.myurl.com/Application" />
</conditions>
<action type="Rewrite" url="http://{HTTP_HOST}:786/{R:0}" />
</rule>