<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WWW Redirect Right property" stopProcessing="true">
<match url=".*"/>
<conditions>
<add input="{HTTP_HOST}" pattern="^www\.xxx\.cn$" negate="true" />
</conditions>
<action type="Redirect" url="{MapSSL:{HTTPS}}www.xxx.cn/{R:0}" redirectType="Permanent"/>
</rule>
</rules>
<rewriteMaps>
<rewriteMap name="MapSSL" defaultValue="http://">
<add key="ON" value="https://" />
<add key="OFF" value="http://" />
</rewriteMap>
</rewriteMaps>
</rewrite>
</system.webServer>
</configuration>
Created
June 12, 2016 04:03
-
-
Save ihipop/a09b0ad253a007b71b8b702f5d37a3c7 to your computer and use it in GitHub Desktop.
IIS7 配置web.config使用重定向来规范主机域名 自适应HTTP/HTTPS协议 ///// IIS7 web.config Redirct to a Canonical Host Name with correct HTTP/HTTPS scheme
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment