宝塔bt网站环境在WIN系统中强制开启HTTPS/SSL跳转的方法

2018-04-07 21:20:37 6817

需要在网站设置中,“配置文件”配置添加如下代码:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="HTTP to HTTPS redirect" stopProcessing="true">
                    <match url="(.*)" ></match>
                    <conditions>
                        <add input="{HTTPS}" pattern="^OFF$" ></add>
                    </conditions>
                    <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" ></action>
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
    </configuration>

被捕了.jpg

提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: