I'm getting too many redirects with my two rules in IIS. One rule is to redirect all traffic to HTTPS, the other is to redirect to a 'not supported' page for browsers that don't fit my mapped criteria - this page is at the top level of the app. I am trying to exclude this 'NotSupported' page from the HTTPS rule as I believe this is what is causing all the redirects - but, it's not working... Anyone see what I'm doing wrong?
Thanks
<rewrite>
<rules>
<rule name="UserAgent MSIE Rewrite" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{HTTP_USER_AGENT}" pattern="Chrome|MSIE 8.0|MSIE 7.0b|MSIE 7.0|MSIE 6.0b|MSIE 6.0|MSIE 5.5b1|MSIE 5.5|MSIE 5.0|MSIE 5.01|MSIE 4.0" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/NotSupported.html" appendQueryString="false" redirectType="Permanent" />
</rule>
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_URI}" negate="true" pattern="^/NotSupported\.html$" ignoreCase="true" />
<add input="{HTTPS}" pattern="^OFF$" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{REQUEST_URI}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
EDIT:
This works (redirecting to Google)...
<rule name="UserAgent MSIE Rewrite" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*" ignoreCase="true" negate="false" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{REQUEST_URI}" negate="true" pattern="^/notsupported$" ignoreCase="true" />
<add input="{HTTP_USER_AGENT}" pattern="Chrome|MSIE 8.0|MSIE 7.0b|MSIE 7.0|MSIE 6.0b|MSIE 6.0|MSIE 5.5b1|MSIE 5.5|MSIE 5.0|MSIE 5.01|MSIE 4.0" />
</conditions>
<action type="Redirect" url="http://www.google.com/" appendQueryString="false" redirectType="Found" />
</rule>
But this doesn't - trying to use an internal address. How can I exclude this rule on that page so it stops the loop?
<rule name="UserAgent MSIE Rewrite" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*" ignoreCase="true" negate="false" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{REQUEST_URI}" negate="true" pattern="^/notsupported$" ignoreCase="true" />
<add input="{HTTP_USER_AGENT}" pattern="Chrome|MSIE 8.0|MSIE 7.0b|MSIE 7.0|MSIE 6.0b|MSIE 6.0|MSIE 5.5b1|MSIE 5.5|MSIE 5.0|MSIE 5.01|MSIE 4.0" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/notsupported.html" appendQueryString="false" redirectType="Found" />
</rule>
Any ideas?