温馨提示×

网站如何整站301跳转到https

小新
474
2021-01-06 08:12:37
栏目: 云计算

网站如何整站301跳转到https

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

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

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <rewrite>

            <rules>

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

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

                    <conditions logicalGrouping="MatchAny">

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

                    </conditions>

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

                </rule>

            </rules>

        </rewrite>

    </system.webServer>

</configuration>

0