最新公告
  • 欢迎您光临仿站吧 帝国CMS模板一站式建站供应平台 . 欢迎加入VIP
  • IIS7配置web.config,http重定向到https,不带www转向www域名规则

    正文概述 仿站吧   2021-10-24 20:08:51  
    IIS7配置web.config,http重定向到https,不带www转向www域名规则

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                    <rule name="HTTP to HTTPS redirect" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions>
                            <add input="{HTTPS}" pattern="^OFF$" />
                        </conditions>
                        <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="SeeOther" />
                    </rule>
                    <rule name="不带www转向www域名规则" stopProcessing="true">
                        <match url="(.*)" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{HTTP_HOST}" pattern="^kaifatu.com$" ignoreCase="false" />
                        </conditions>
                        <action type="Redirect" url="https://www.kaifatu.com{R:1}" redirectType="Found" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
    仿站吧,一个优质的源码资源平台!
    仿站吧 » IIS7配置web.config,http重定向到https,不带www转向www域名规则