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

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>

Published by

风君子

独自遨游何稽首 揭天掀地慰生平

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注