下载安装URL重写模块
直接复制到浏览器:https://www.iis.net/downloads/microsoft/url-rewrite
安装url重写2.0之后就可以编辑web.config把以下代码加进去
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="http redirect to https" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{HTTPS_HOST}" pattern="^(localhost)" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
通过以上步骤就可以实现http跳转到https了,是不是很方便呢,如看不懂可以联系我们在线客服寻求帮助!