【发布时间】:2014-07-31 04:30:34
【问题描述】:
我试图在我们网站的所有页面上强制使用 http,但结帐页面除外。我使用了下面的重写规则,但它不适用于 url 中的 www 子域。
如果我使用https://domain.com,它会成功重定向到http://www.domain.com,但如果我尝试使用带有www 的https,则没有任何反应。请注意,还有一个规范的域名重定向,但如果没有这个规则,这个问题仍然会发生。
<rule name="No-https" enabled="true" stopProcessing="true">
<match url=".*" negate="false" />
<action type="Redirect" url="http://{HTTP_HOST}{REQUEST_URI}" />
<conditions>
<add input="{HTTPS}" pattern="on" />
<add input="{URL}" pattern="CheckOut" negate="true" />
</conditions>
</rule>
这让我整个上午都发疯了,我希望有更多 IIS 重写经验的人能给我一些帮助。
【问题讨论】: