具有完全匹配https url的IIS重写规则会导致错误

时间:2014-11-30 15:05:08

标签: asp.net-mvc iis

我已经将一个站点从ASP.NEt webforms转换为MVC 5并成功编写了规则来重定向所有旧的.aspx页面 - 除了唯一的加密页面。

我非常感谢帮助纠正此规则,从而导致net :: ERR_CORRECTION_RESET

<rule name="https link" stopProcessing="true" patternSyntax="ExactMatch">
<match url="https://www.mysite.org/ssl/securedonation.aspx" />

 <action type="Redirect" url="/donate/" redirectType="Permanent"/>
</rule> 

我怀疑我需要添加条件,但无法弄清楚它的语法或功能。

非常感谢。

1 个答案:

答案 0 :(得分:2)

如果您只想在https而不是http上匹配,则只需添加条件。但在你的情况下,我认为这并不重要。您可以将securedonation.aspx页面重定向到/ donate /,因为它使用https,所以不需要对此进行任何区别对待。试试这个:

<rule name="https link" stopProcessing="true" patternSyntax="ExactMatch">
    <match url="ssl/securedonation.aspx" />

    <action type="Redirect" url="/donate/" redirectType="Permanent"/>
</rule>