Iis 7 IIS7将https重定向到http,1页除外

Iis 7 IIS7将https重定向到http,1页除外,iis-7,Iis 7,我有个规矩 <rule name="HTTPS to HTTP Redirect" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTPS}" pattern="on" /> <

我有个规矩

<rule name="HTTPS to HTTP Redirect" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
       <add input="{HTTPS}" pattern="on" />
    </conditions>
    <action type="Redirect" url="http://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>

这重定向到HTTP的所有HTTPS,但我现在需要1页的HTTPS


谢谢,试试这个。我假设您要强制使用HTTPS的页面是login.aspx

<rewrite>
<rules>
    <rule name="Force HTTPS for 1 page " stopProcessing="true">
        <match url="(.*)/login.aspx" />
        <conditions>
            <add input="{HTTPS}" pattern="^OFF$" />
        </conditions>
        <action type="Redirect" url="https://{HTTP_HOST}/{R:0}" redirectType="Permanent" />
    </rule>
    <rule name="Others Force HTTP" stopProcessing="true">
        <match url="((.*))" negate="true" />
        <conditions>  
            <add input="{HTTPS}" pattern="^ON$" />
        </conditions>
        <action type="Redirect" url="http://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" />
    </rule>
</rules>
</rewrite>

您好,您可以尝试下面的正则表达式:这将与https匹配所有内容,但help.html页面除外

^[hH][Tt]{2}[pP][Ss](?!.*help.html).*$