怎么高http跳转https跳转的代码

下面代码以本站网址zhangshao.shop为示例,请根据需要自行修改。修改后复制跳转代码,粘贴到站点根目录下web.config或新建web.config文件中。


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

<configuration>

 <system.webServer>

        <rewrite>

            <rules>

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

                    <match url="^(.*)$" ignoreCase="false" ></match>

                    <conditions logicalGrouping="MatchAll">                       

                         <add input="{HTTP_FROM_HTTPS}" pattern="^on$" negate="true" ></add>  

                  </conditions>

                    <action type="Redirect" url="https://www.zhangshaobiji.cn/{R:1}" redirectType="Permanent" ></action>

               </rule>

            </rules>

        </rewrite>

    </system.webServer> 

</configuration>



是不是很简单

推荐推门
搜索
标签
«    2024年5月    »
12345
6789101112
13141516171819
20212223242526
2728293031
网站分类
文章归档
 
Copyright © 2021张少学习分享网 All Rights Reserved 黔ICP备2021004591号