IIS 配置Http重定向到Https

Posted 厚积薄发

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IIS 配置Http重定向到Https相关的知识,希望对你有一定的参考价值。

注意首先要安装url重定向模块
然后在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>

以上是关于IIS 配置Http重定向到Https的主要内容,如果未能解决你的问题,请参考以下文章