I am running into a problem when trying to construct a rewritten URL that contains backreferences to more than one condition.
I am trying to match more than one QueryString variable, and the complicating factor with QueryStrings is that you never know the order the variables will be in. So I am using one condition per QueryString variable.
For example:
<conditions>
<add input="{QUERY_STRING}" pattern="(?:^|&)var1=([1-9]\d+)(?:&|$)" />
<add input="{QUERY_STRING}" pattern="(?:^|&)var2=([1-9]\d+)(?:&|$)" />
</conditions>
My assumption was that the first condition would make {C:0} and {C:1} available, and the second condition would make {C:2} and {C:3} available.
Thus, my rewrite rule looks like this:
<action type="Redirect" url="newpage.aspx/{C:1}/{C:3}" appendQueryString="false" redirectType="Permanent" />
However, the URL Rewriter tool gives me the error message, "Invalid condition back reference. The index 3 is invalid."
So how am I supposed to access the backreferences in all the conditions that come after the first one?
Thanks very much for your help!