繁体   English   中英

301的IIS 7.5 UrlRewrite规则重定向到小写url

[英]IIS 7.5 UrlRewrite rule for 301 redirect to lowercase url

我需要一个URL重写规则以使301重定向到小写的url。 例如, http://example.com/CurRENcies/USD应该变成http://example.com/currencies/usd

我有以下重写规则:

<rule name="LowerCaseRule1" stopProcessing="true">
<match url="[A-Z]" ignoreCase="false" />
<action type="Redirect" url="{ToLower:{URL}}" redirectType="Permanent"/>
</rule>

我该如何仅针对GET请求进行重定向?

尝试这个:

<rule name="LowerCaseRule1" stopProcessing="true">
<match url="^.*[A-Z]+.*$" ignoreCase="false" />
<conditions>
   <add input="{REQUEST_METHOD}" matchType="Pattern" pattern="GET" ignoreCase="true" />
</conditions>
<action type="Redirect" url="{ToLower:{URL}}" redirectType="Permanent"/>
</rule>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM