• IIS8.5中的强制https直接修改web.config文件和顶级域名跳转www和过滤子目录不强制跳转


    亲测可用

    <?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>
  • 相关阅读:
    switch语句
    switch语句
    if语句三种格式
    dowhile语句
    if语句三种格式
    if语句配对
    ansible
    linux系统中网站服务程序(web服务/httpd服务)
    ansible
    ansible
  • 原文地址:https://www.cnblogs.com/baker95935/p/11298925.html
Copyright © 2020-2023  润新知