Reputation: 319
I need a Url-rewrite rule to make a 301-redirect to url in lowercase. For example http://example.com/CurRENcies/USD should become http://example.com/currencies/usd.
I have the following rewrite rule:
<rule name="LowerCaseRule1" stopProcessing="true">
<match url="[A-Z]" ignoreCase="false" />
<action type="Redirect" url="{ToLower:{URL}}" redirectType="Permanent"/>
</rule>
How can I do this redirects only for GET requests?
Upvotes: 0
Views: 249
Reputation: 3952
Try this:
<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>
Upvotes: 1