【发布时间】:2011-10-18 11:41:24
【问题描述】:
每当有人通过 HTTP 协议发出请求时,我都会重写 url 以使其成为 HTTPS。这是 web.config 中的代码:
<rule name="Imported Rule 1-1" enabled="true" stopProcessing="true">
<match url="^(?!https://).*" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{SERVER_PORT}" pattern="80" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="https://abc.com/{R:1}" />
</rule>
但是当我在 http:// 上浏览时,我得到 IIS 错误
HTTP 错误 500.50 - URL 重写模块错误。表达式
"https://abc.com/{R:1}"无法展开。
我该如何解决这个问题?我完全糊涂了。
【问题讨论】:
-
我现在也收到了。你有没有找到解决办法?如果是,请在此处发布。
-
附言。您可以在
match中使用negate="true"。
标签: asp.net iis url-rewriting iis-7 url-rewrite-module