2017-10-13 294 views
0

我有这个网站“localhost”。我希望所有页面都应该有https,除了“localhost/order.aspx?r = 15”。问题在于它将所有页面重定向到HTTPS,包括“localhost/order.aspx?r = 15”。我也曾尝试模式类似 “^ /本地主机/ order.aspx $”HTTPS否定不起作用

<rule name="Force HTTPS" stopProcessing="true"> 
 
    <match url="(.*)" /> 
 
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> 
 
    <add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
 
    <add input="{REQUEST_URI}" pattern="(order.*)" ignoreCase="true" negate="true" /> 
 
    </conditions> 
 
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" /> 
 
    </rule>

回答

0

所以我固定它。 清除浏览器缓存,因为通常时间浏览器记住HTTPS路径。并尝试检索HTTPS,即使只提供HTTP也是如此。 我会推荐使用IE来测试这个。

更新这样的规则。

<rule name="NoSSL - folder" enabled="true" stopProcessing="true"> 
 
    <match url="order.*" /> 
 
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> 
 
    </conditions> 
 
    <action type="None" /> 
 
</rule> 
 
<rule name="Redirect to HTTPS" enabled="true" stopProcessing="true"> 
 
    <match url="(.*)" /> 
 
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> 
 
     <add input="{HTTPS}" pattern="off" /> 
 
    </conditions> 
 
    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Found" /> 
 
</rule>