IIS Http自动跳转Https
1.安装SSL证书
免费申请:
a. https://letsencrypt.osfipin.com
b. 阿里云
c. https://freessl.cn/ssltools
3.Web.Config配置
打开项目的Web.Config配置文件,在<system.webServer>中,配置如下重定向代码:
<rewrite>
<rules>
<rule name="xinxin" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>

浙公网安备 33010602011771号