虚拟主机Web.config 301 设置http跳转https

蜗牛vps教程2021-12-082960

RewriteEngine On

 

RewriteCond %{HTTPS} !=on

 

RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]

 

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


评论

有免费节点资源,我们会通知你!加入纸飞机订阅群

×
天气预报查看日历分享网页手机扫码留言评论电报频道链接