咨询热线:4006-75-4006

售前:9:00-23:30    备案:9:00-18:00    技术:7*24h

IIS利用web.config文件设置https的301跳转

2019-11-12 14:00:45 6855次

将下列代码粘贴进站点根目录下的web.config文件里服的

<system.webServer>节点下保存即可


<rewrite>

    <rules> 

        <rule name="wwwRedirect" stopProcessing="true">

            <match url=".*" /> 

            <conditions>

                <add input="{HTTP_HOST}" pattern="^wu-168.cn$" />

            </conditions>

            <action type="Redirect" url="https://www.landui.com/{R:0}" redirectType="Permanent" />

        </rule>

        <rule name="HTTP to HTTPS redirect" stopProcessing="true">

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

            <conditions>

                <add input="{HTTPS}" pattern="off" ignoreCase="true" />

            </conditions>

            <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />

        </rule>

    </rules>

</rewrite>


首页
最新活动
个人中心