【发布时间】:2026-01-29 10:10:01
【问题描述】:
我有这个重写规则:
<rewrite>
<rules>
<rule name="Redirect to http" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" negate="false" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
</rule>
</rules>
</rewrite>
我想将所有 http 重定向到 https 流量,但问题是我的 web 应用程序不在根文件夹中,所以它是这样的:
http:\\my-site.com\MyWebApp\some-parameters-here
然后重定向到:
https:\\my-site.com\some-parameters-here
...而不是
https:\\my-site.com\MyWebApp\some-parameters-here
如何在不硬编码 URL 中的该部分的情况下修复此重定向?
【问题讨论】:
标签: iis url-rewriting iis-7