Linux 拨号vps windows公众号手机端

网站如何整站301跳转到https

lewis 7年前 (2018-11-27) 阅读数 10 #VPS/云服务器
文章标签 301跳转

网站整站301跳转到https的方法:

在网站根目录修改web.config的配置文件,例如:

<?xmlversion="1.0"encoding="UTF-8"?>

<configuration>

<system.webServer>

<rewrite>

<rules>

<rulename="301"stopProcessing="true">

<matchurl="(.*)"/>

<conditionslogicalGrouping="MatchAny">

<addinput="{HTTP_HOST}"pattern="^abc\.cn$"/>

</conditions>

<actiontype="Redirect"url="https://www.abc.cn/{R:0}"/>

</rule>

</rules>

</rewrite>

</system.webServer>

</configuration>

版权声明

本文仅代表作者观点,不代表米安网络立场。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

热门