Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

Re-write exception not working

$
0
0

Hi

I have written a rule to redirect all requests to another domain with the exception of urls containing "wiki" and where I access the old domain as "localhost".

The wiki part works as expected however I can't get the localhost exception to work - it seems to be ignored. I have tested the rule using the "Test pattern" facility in IIS and it matches as expected (matches localhost / subdomain.localhost /http://locahost etc)

I have tried other variants eg ".*localhost.*" but the result is the same.

I am obviously doing something stupid but two hours of Googling haven't got me anywhere. Any help much appreciated; thank you!

<rewrite>
<rules>
<rule name="Redirect NewDomain" enabled="true" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="localhost" negate="true" />
<add input="{PATH_INFO}" pattern="^/wiki/*" negate="true" ignoreCase="true" />
</conditions>
<action type="Redirect" url="http://www.newdomain.com/" redirectType="Permanent" />
</rule>
</rules>
</rewrite>


Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>