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

The idea is to add a rule to my iis (version 7) to redirect this


But it have to be only with this specific url and all the urls must mantain the same thing

I read this article but is for patterns and all url and this is an specific url


share|improve this question

1 Answer 1

up vote 0 down vote accepted

Try this:

        <rule name="MyRule" patternSyntax="ECMAScript" stopProcessing="true">
          <match url="^folder/Default.aspx$" />
              redirectType="Found" /> 

          <conditions logicalGrouping="MatchAny">
            <add input="{QUERY_STRING}" 
                 pattern="^&amp;variable1=eeee&amp;variable2=aaa$" />

            <add input="{QUERY_STRING}" 
                 pattern="^variable1=eeee&amp;variable2=aaa$" />

Set the redirectType attribute in the <action> element to one of:

  • Permanent for a 301 Permanent redirect
  • Found for a 302 Found redirect

This covers the possibility of the query string being:

&variable1=eeee&variable2=aaa - as per your example, with a leading ampersand

or with the leading ampersand:


If you just want a straight rewrite without doing a redirect then change the <action> element to:

<action type="Rewrite" 
        appendQueryString="false" />
share|improve this answer
Hi Kev, it worked great!, can I ask you one more favor? I have a problem with some special characters on one of the urls:… – Saikios May 8 '12 at 22:36
@Saikios - glad it worked. Just ask a new question on the site. – Kev May 8 '12 at 22:40
done @kev… – Saikios May 9 '12 at 3:04
If your IIS web site's root isn't an ASP.Net application, do you need to stick the rewrite rules in machine.config? – Remi Despres-Smyth Sep 23 '13 at 17:58

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.