首页技术博客 服务器运维 正文

WINDOWS 宝塔 强制跳转HTTPS代码!!

2018-03-01 1842 0条评论

只需要在网站设置中,“配置文件”配置一下就行了


<?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>

 

 


文章版权及转载声明

本文作者:符文浩 网址:http://blog.fuwenhao.com/post/30.html 发布于 2018-03-01
文章转载或复制请以超链接形式并注明出处。

发表评论

快捷回复:

评论列表 (暂无评论,1842人围观)参与讨论

还没有评论,来说两句吧...

取消
微信二维码
微信二维码
支付宝二维码