【发布时间】:2011-07-21 10:04:46
【问题描述】:
我想要将poo.example.com 重定向到poo.example.com/home.ashx,但我使用以下代码失败了;
<rewrite>
<rules>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
</rule>
<rule name="Redirect poo.example.com to poo.example.com/home.ashx" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(./)" />
<action type="Redirect" url="https://{HTTP_HOST}/home.ashx" />
</rule>
</rules>
</rewrite>
我使用的是 IIS 7.5。
注意
我厌倦了使用默认文档,但它不起作用。我的应用程序是一个 asp.net mvc 应用程序。它可能与此有关,但这在这里不是问题。我需要使用 IIS URL 重写功能来实现它。
【问题讨论】:
-
也许this 有帮助?
标签: asp.net regex iis iis-7 url-rewriting