http 强制跳转https
1.安装IIS UrlReWriter 模块
https://www.iis.net/downloads/microsoft/url-rewrite
2.web.config作如下配置
<rewrite>
<rules>
<rule name="http转https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>

浙公网安备 33010602011771号