当前位置: 移动技术网 > 网络运营>服务器>Windows > IIS7 http自动跳转到https

IIS7 http自动跳转到https

2017年12月14日  | 移动技术网网络运营  | 我要评论

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

32位:

64位:

2.站点的SSL设置,不要勾选(很重要)

3.Web.config添加配置节点,以重定向到https


<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>
以上config配置会自动生成配置到iis站点中,到此即完成了自动的跳转配置。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网