【发布时间】:2011-06-24 04:06:51
【问题描述】:
我需要将我的 HTTP 站点重定向到 HTTPS,添加了以下规则,但尝试使用 http://www.example.com 时出现 403 错误,当我在浏览器中键入 https://www.example.com 时它工作正常。
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
【问题讨论】:
-
违反规则?什么意思?
-
我在 IIS 下使用“URL rewirte”模块添加了规则,并且在 web.config 中。
标签: asp.net-mvc http redirect https