记录一下,方便以后使用。

代码如下:

<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>

标签: iis, IIS8, https, http, web.config

添加新评论