IIS7 https到http重定向在www子域上不起作用

IIS7 https到http重定向在www子域上不起作用,iis,redirect,rewrite,Iis,Redirect,Rewrite,我试图在我们网站的所有页面上强制使用http,但结帐页面除外。我使用了下面的重写规则,但它不适用于url中的www子域 如果我使用它成功重定向到,但如果我尝试使用https和www,什么也不会发生。请注意,也有一个规范的域名重定向到位,但这个问题仍然发生没有这个规则 <rule name="No-https" enabled="true" stopProcessing="true"> <match url=".*" negate="false" /> <ac

我试图在我们网站的所有页面上强制使用http,但结帐页面除外。我使用了下面的重写规则,但它不适用于url中的www子域

如果我使用它成功重定向到,但如果我尝试使用https和www,什么也不会发生。请注意,也有一个规范的域名重定向到位,但这个问题仍然发生没有这个规则

<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重写经验的人能给我一些帮助。

在类似的问题上花了几个小时。在我的例子中,我将流量从http重定向到https,我希望在使用子域时也这样做,例如,重写到。对于IIS 7.5,似乎至少需要在IIS中为每个特定子域添加一个http绑定,否则将无法通过下面的“捕获所有”匹配来获取该绑定

    <rewrite>
        <rules>
            <clear />
            <rule name="Redirect to https" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                    <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                </conditions>
                <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
            </rule>
        </rules>
    </rewrite>