【发布时间】:2015-06-03 16:54:34
【问题描述】:
我想使用 IIS 8.5 中的 URL 重写模块将任何非 https 流量从 http://something.com:112 重定向到 https://something.com:444(请注意,这些不是标准的 http 和 https 端口号)。
我尝试使用此重写规则,但它不起作用:
<rewrite>
<rules>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{SERVER_PORT}" pattern="^444$" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}:444/{R:1}" redirectType="Found" />
</rule>
</rules>
</rewrite>
我在失败的请求日志中得到的错误是:
模块名称 IIS Web 核心 通知 MAP_REQUEST_HANDLER Http状态 404 未找到 HttpReason HttpSubStatus 0 ErrorCode 系统找不到指定的文件。 (0x80070002)
我做错了什么?
【问题讨论】:
-
小更新,在 Safari 浏览器中,我终于可以确定 URL 正在更改为 something.com:112:444。如何从最终到达网址中取出“:112”?
标签: url-rewrite-module iis-8.5