Windows server IIS7/8/10版本 http自动跳转到https代码

2018-05-08 0 1,951 百度已收录

1.下载安装URL重写模块:Microsoft URL Rewrite Module

32位:http://download.microsoft.com/download/4/9/C/49CD28DB-4AA6-4A51-9437-AA001221F606/rewrite_x86_zh-CN.msi

64位:http://download.microsoft.com/download/4/E/7/4E7ECE9A-DF55-4F90-A354-B497072BDE0A/rewrite_x64_zh-CN.msi

 

2.SSL设置不要勾选(很重要)

Windows server IIS7/8/10版本 http自动跳转到https代码

 

3.Web.config添加

<system.webServer>
   <rewrite>
     <rules>
       <rule name="HTTP to HTTPS redirect" stopProcessing="true">
         <match url="(.*)" />
         <conditions>
           <add input="{HTTPS}" pattern="off" ignoreCase="true" />
         </conditions>
         <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
       </rule>
     </rules>
   </rewrite>
 </system.webServer>

 

收工!~

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

栗子博客 网站 Windows server IIS7/8/10版本 http自动跳转到https代码 https://www.lizi.tw/web/5309.html

建筑工地上施工员,闲暇时弄个博客打发时间,

常见问题
  • 1、杰齐1.7仅适用于PHP5.2 2、需Zend支持 3、尽量使用宝塔面板 4、尽量使用Windows 系统,关关对Linux支持不太友好。
查看详情

相关文章

评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务

Windows server IIS7/8/10版本 http自动跳转到https代码-海报

分享本文封面