Evaluation when defining multiple Precondition in the IIS URL Rewrite module

33 views Asked by At

I wrote the following rules:

<rule name="RedirectFQDNChange" preCondition="condition2" enabled="true" patternSyntax="ECMAScript">
    <match serverVariable="RESPONSE_Location" pattern="^.*-etc.azurewebsites.net/(.*)" />
    <conditions>
        <add input="{HTTP_X_ORIGINAL_HOST}" pattern="site1.com" />>
    </conditions>
    <action type="Rewrite" value="https://sute1.com/{R:1}" />
</rule>




<preConditions>
    <preCondition name="condition1">
        <add input="{RESPONSE_STATUS}" pattern="3\d\d" />
    </preCondition>
    <preCondition name="condition2">
        <add input="{HTTP_X_ORIGINAL_HOST}" pattern="site1.com|site2.com" />
        <add input="{RESPONSE_STATUS}" pattern="3[0-9][0-9]" />
    </preCondition>
<preConditions>

Http_x_original_host shall be defined in site1.com. In this case, will the second Condition2 of Precondition meet and RedirectRuleChangeredirect rewrite?

If you know what the operation is defined by multiple Precondition, please let me know.

0

There are 0 answers