Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Rewrite exclude rule by http method

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>
like image 294
David Freire Avatar asked Jun 06 '14 18:06

David Freire


1 Answers

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>
like image 154
David Freire Avatar answered Dec 17 '22 10:12

David Freire