Can I add a condition to exclude an IIS URL Rewrite rule if the request type is POST
? I was not able to find it anywhere in the documentation.
I don't want to lower-case my URL if the HTTP method is POST
.
<rule name="LowerCaseRule" stopProcessing="true">
<match url="[A-Z]" ignoreCase="false" />
<action type="Redirect" url="{ToLower:{URL}}" />
</rule>
The solution is filtering the input {REQUEST_METHOD}
, negating every request matching POST
, like:
<conditions>
<add input="{REQUEST_METHOD}" pattern="^POST$" ignoreCase="true" negate="true" />
</conditions>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With