关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

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

发布时间:2021-12-08 10:34:34
1491984010112764.jpg

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>



/template/Home/8a/PC/Static