SSL证书、代码签名证书、文档签名、WHQL 认证服务提供商

IIS8 通过直接修改web.config 实现http跳转到https的方法


下载安装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了,是不是很方便呢,如看不懂可以联系我们在线客服寻求帮助!