关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

云服务器https301跳转重定向到http的方法

发布时间:2022-10-09 20:28:10
1491984010112764.jpg

http重定向跳转到https比较简单,https重定向到http相关资料较少,以下方法适用于IIS架构的服务器,将代码另存为web.config后保存到网站根目录即可生效。


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

 <configuration>

 <system.webServer>

 <rewrite>

 <rules> 

<rule name="Redirect to HTTP" stopProcessing="true">

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

     <conditions>

       <add input="{HTTPS}" pattern="^ON$" />

     </conditions>

     <action type="Redirect" url="http://{HTTP_HOST}/{R:1}" redirectType="Permanent" />

 </rule>

</rules>

</rewrite>

 </system.webServer>

 </configuration>


注意以上代码是https跳转到http。



/template/Home/8a/PC/Static