Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

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

and the url that is comming in is http://www.example2.se/player/default.aspx?id=37185&metadatalanguageId=1

The result is that i am redirected to http://www.example.se/play?id=

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

1 Answer 1

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

 
discard

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.