【发布时间】:2014-09-11 13:34:20
【问题描述】:
我正在尝试将我网站上的特定 URL 转发到另一个网站,但我不知道如何在我的 IIS 服务器的 web.config 文件中设置正确的值。
例如我想转发 www.example.com/ballot 到 ballot.example.com
到目前为止,我已经尝试了以下方法,但它对 url 没有任何影响
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^/ballot$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^example\.com$" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="http://ballot.example.com/" />
</rule>
</rules>
</rewrite>
我将网站托管在 Rackspace Cloud 网站上。
【问题讨论】:
-
有人吗?我真的可以在这方面使用一些帮助。我正在寻找解决方案,但我尝试的任何方法都不起作用。我认为这就像在 apache 服务器上使用 .htaccess 文件设置重定向一样简单。
标签: asp.net iis web-config rewrite windows-server-2012