【发布时间】:2016-06-03 11:36:13
【问题描述】:
我安装了IIS URL Rewrite 2.0 并添加了一条规则以将所有 http 链接重定向到 https。这是我的Web.Config 代码:
<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>
</rules>
</rewrite>
一切看起来都很好。但是当我使用 http 访问我的网站时,它会抛出 403 错误。
403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.
TLS 1.0 在 IIS 7.5 中启用。
我可以从哪里获得有关它究竟是什么类型的 403 错误的更多信息?
【问题讨论】:
-
在禁用重写规则的情况下网站是否可以正常工作?
-
是的。禁用时它工作正常。
-
它是否适用于
https? -
是的。我已经为它配置了 443,它工作正常。
-
试试
redirectType = "Found"或"Permanent"
标签: asp.net iis url-rewriting