Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AND AND OR in Web Config Rewrite

Status
Not open for further replies.

JAG14

Programmer
Sep 26, 2003
469
GB
Is it possible to use a match "PATH_INFO(Negated) AND ANY other condition" in Web.Config?

I currently have multiple items the same as below

Code:
<rule name="Rewrite to Site1 Root" stopProcessing="true">
  <match url="(.*)" />
  <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{HTTP_HOST}" pattern="^([URL unfurl="true"]www\.)?site1.co.uk$"[/URL] />
    <add input="{PATH_INFO}" pattern="^/ourapp/" negate="true" />
  </conditions>
  <action type="Rewrite" url="/ourapp/{R:1}" />
</rule>
<rule name="Rewrite to Site2 Root" stopProcessing="true">
  <match url="(.*)" />
  <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{HTTP_HOST}" pattern="^([URL unfurl="true"]www\.)?site2.co.uk$"[/URL] />
    <add input="{PATH_INFO}" pattern="^/ourapp/" negate="true" />
  </conditions>
  <action type="Rewrite" url="/ourapp/{R:1}" />
</rule>

Bearing in mind that all the domains point to one application, which then sorts what site needs to be shown. I would like to condense these (possibly 50-100) into one rule. Is this possible or is there a better way of doing it using another tool?

Thanks in advance,

JaG

yosherrs.gif

[tt]'Very funny, Scotty... Now Beam down my clothes.'[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top