下载安装URL重写模块:Microsoft URL Rewrite Module
备用:https://www.iis.net/downloads/microsoft/url-rewrite
可直接修改web.config(需安装urlrewrite模块)
<?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>
原文地址:https://blog.csdn.net/u010483472/article/details/89209153
原文地址:https://www.cnblogs.com/tangge/p/4259749.html
评论区