新闻公告

提供实时新闻动态,活动公告等通知,第一时间了解企业动态。
新闻公告关注获取即时动态

IIS8 http自动跳转到HTTPS 设置教程

2022-11-14 08:31 来源:珑珲云 阅读量:386

需要先确认是否安装 “URL REWRITE2 ” 伪静态模块 , 如果您已经安装可以跳过URL REWIRTE (伪静态模块)

直接把伪静态添加到 web.config 

完整代码参考:

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

<configuration>

<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>

</configuration>

这样就完成了!!