首先下载安装 iis url-rewrite
下载地址:https://www.iis.net/downloads/microsoft/url-rewrite
按图填入:(.*) “{HTTPS}” “^OFF$”
https://{HTTP_HOST}/{R:1}
下面是web.config部分规则:
<rule name=”https” stopProcessing=”true”>
<match url=”(.*)” />
<conditions logicalGrouping=”MatchAny”>
<add input=”{HTTPS}” pattern=”^OFF$” />
</conditions>
<action type=”Redirect” url=”https://{HTTP_HOST}/{R:1}” />
</rule>
发表回复