环境配置教程

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

2021-04-20 11:29


II8强制HTTPS跳转

                                            




需要先确认是否安装 “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>

这样就完成了!!


标签:
  • iis伪静态,https跳转