I have a site which recently went live. At present all requests for the staging site are caught by the rewrite rules and 301d to the live site, however I now need to allow the homepage only to bit hit, with all other requests redirecting as before to their equivalent page on live.
The first part was straightforward enough:
<rule name="Point to live" stopProcessing="true">
<match url="^(.*)" ignoreCase="true" />
<action type="Redirect" url="http://www.mysitename.co.uk/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
and i thought the second part would be too (but it doesnt work :/)
<rule name="Point to live" stopProcessing="true">
<match url="^(.*)" ignoreCase="true" />
<!-- Except for homepage requests -->
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" negate="true" pattern="http://mysitename.our-test.com/" />
<add input="{HTTP_HOST}" negate="true" pattern="http://mysitename.our-test.com/default.aspx" />
</conditions>
<action type="Redirect" url="http://www.mysitename.co.uk/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
Im probably doing something stupid, any help would be gretaly appreciated.