baker95935

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

亲测可用

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>

<rule name="301Redirect" stopProcessing="true">

<match url="(.*)" />

<conditions logicalGrouping="MatchAny">

<add input="{HTTP_HOST}" pattern="^seo-6.com$" />

</conditions>

<action type="Redirect" url="http://www.seo-6.com/{R:0}" redirectType="Permanent" />

</rule>

                <rule name="http redirect to https" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
                        <add input="{HTTPS_HOST}" pattern="^(localhost)" negate="true" />
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
                </rule>
//这个是xiaomingmm目录不强制HTTPS

<rule name="HttpToHttps" stopProcessing="true">
<match url="^((?!xiaoxingmm).)*$" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:0}" />
</rule>//到这结束

            </rules>
        </rewrite>
    </system.webServer>
</configuration>

 

posted on 2019-08-04 17:34  baker95935  阅读(1499)  评论(0)    收藏  举报