我已经将一个站点从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>
我怀疑我需要添加条件,但无法弄清楚它的语法或功能。
非常感谢。
答案 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>