zoukankan      html  css  js  c++  java
  • IIS http 重定向到https

    在IIS中把http重定向到https有多种方式,常见如下:

    1.在<system.webserver>节点下添加子节点:
    <rewrite>
    <rules>
    <clear/>
    <rule name="Redirect HTTP to HTTPS" stopProcessing="true">
    <match url="(.*)"/>
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{HTTPS}" pattern="^OFF$"/>
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}{HTTP_URL}" redirectType="Found"/>
    </rule>
    </rules>
    </rewrite>

    2.IIS 配置URL Rewrite(配置后会生成上面的节点,同样效果)

    添加规则
    正则匹配模式->正则: (.*) -> condition-> {HTTPS} | ^OFF$
    ->Action ->Redirect->https://{HTTP_HOST}{HTTP_URL}->302

  • 相关阅读:
    linux运维、架构之路-MySQL主从复制
    多线程
    IO
    查看信息
    乱码
    字节流与字符流
    file
    JDBC
    规范
    Java常用包
  • 原文地址:https://www.cnblogs.com/DONET-LC/p/14134451.html
Copyright © 2011-2022 走看看