Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im using IIS7 with the URL rewrite module and I can not make it work properly. The rule looks like this in web.config

            <rule name="Redirect to new enviroment" stopProcessing="true">
                <match url="default.aspx" />
                <action type="Redirect" url="{C1}" appendQueryString="false" redirectType="Permanent" />
                <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                    <add input="{QUERY_STRING}" pattern=".*id=(.*)&amp;.*" />

and the url that is comming in is

The result is that i am redirected to

So the id (37185) is missing from the result. When I use test pattern in IIS Manager it looks ok, and says that the back-reference {C:1} should contain the id. What am I missing??? I have tried using "Failed Request Tracing Rules" but everything looks like it should work.

share|improve this question

It looks like your rule is using {C1}, but it should include a colon such as {C:1}

share|improve this answer
I knew it was something stupid. I ripped my hair for several hours but did not see it. Thanks! – Jonatan B Jul 19 '10 at 5:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.