只需要在网站设置中,“配置文件”配置一下就行了
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" ></match>
<conditions>
<add input="{HTTPS}" pattern="^OFF$" ></add>
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" ></action>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
查看原内容