IIS重定向到完整域名
我需要重新定向IIS重定向到完整域名,iis,iis-7,Iis,Iis 7,我需要重新定向 http://someserver/someapplication.page.aspx 到 http://someserver.domain.com/someapplication.page.aspx 两个请求都指向同一台服务器 someserver/通过我们公司的内部DNS工作 这和我的问题是一样的 但是我想要一个IIS解决方案,而不是代码。我猜这与使用通配符在配置编辑器中添加httpRedirect add元素有关。您可以使用URL重写作为在IIS中执行此操作的推荐方法,只需
http://someserver/someapplication.page.aspx
到
http://someserver.domain.com/someapplication.page.aspx
两个请求都指向同一台服务器
someserver/
通过我们公司的内部DNS工作
这和我的问题是一样的
但是我想要一个IIS解决方案,而不是代码。我猜这与使用通配符在配置编辑器中添加httpRedirect add元素有关。您可以使用URL重写作为在IIS中执行此操作的推荐方法,只需使用如下规则添加一个web.config:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to full domain" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^someserver$" />
</conditions>
<action type="Redirect" url="http://someserver.domain.com/{R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
上述内容是否会进入重定向循环?因为在我的示例中,someserver/
和someserver.domain.com/
都在同一台服务器上,我想我找到了我应该研究的问题-感谢您指出我们的方法,重写模块就是这样做的方法看起来就像