Web.Config 重定向规则,IIS 会根据里面的规则自动重定向;
# web redirect to Home page
<rule name="Root Hit Force HTTPS Redirection" enabled="true" stopProcessing="true">
<match url="^$" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{HTTP_METHOD}" pattern="GET" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/en/" redirectType="Permanent" />
</rule>
<rule name="Root Hit Force HTTPS root" enabled="true" stopProcessing="true">
<match url="^$" />
<conditions>
<add input="{HTTP_METHOD}" pattern="GET" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/en/" redirectType="Permanent" />
</rule>
标签:redirect,Web,重定向,首页,规则,Config
From: https://www.cnblogs.com/fires/p/17220711.html