【发布时间】:2018-01-28 02:16:02
【问题描述】:
我有这条规则,将所有 HTTP 流量重定向到 HTTPS:
<rewrite>
<rules>
<rule name="RedirectToHttps" 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>
我在网上找到的。
它适用于没有查询字符串的简单 URL。但它重复了查询字符串。例如http://example.com/path?key=value 变为https://example.com/path?key=value&key=value。
这会导致调试和故障排除出现问题。是什么导致了这种行为?
【问题讨论】: