当前位置:首页 > Web开发 > 正文

URL Rewrite 配置下载

2024-03-31 Web开发

我们也可以手动下载URL Rewrite插件,这是官方地点:URL Rewrite下载,

安置完成后,webconfig添加如下配置。

<rewrite>
<rules>
<rule>
<match url="(.*)" />
<!--匹配所有条件-->
<conditions logicalGrouping="MatchAny">
<!--当不是使用https协议访谒的时候-->
<add input="{HTTPS}" pattern="^OFF$" />
<!--并且访谒的host不是potekelec.com这种,,例如>
<add input="{HTTP_HOST}" pattern="^www\.********\.com$" negate="true" />
</conditions>
<!--跳转到https-->
<action type="Redirect" url="https://www.********.com/{R:1}" redirectType="Permanent" />
</rule>
<rule>
<match url="(.*)" />
<conditions>
<!--当使用HTTPS协议访谒-->
<add input="{HTTPS}" pattern="^ON$" />
<!--当访谒 https://potekelec.com的时候-->
<add input="{HTTP_HOST}" pattern="^www\.********\.com$" negate="true" />
</conditions>
<!--跳转到HTTPS-->
<action type="Redirect" url="https://www.********.com/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>

URL Rewrite 配置下载

标签:

原文地点:https://www.cnblogs.com/tianlong/p/12175817.html

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/31880.html