title: How to append query string & value via IIS rewrite rule?
body: <p>I'm running IIS 7 with the offical rewrite rule module installed. I'd like to create a rewrite rule to match this URL: </p>
  
  <pre class="lang-none prettyprint-override"><code>http://www.sample.com/en-us/test.aspx?q=keyword
  </code></pre>
  
  <p>After rewriting the expected result would be: </p>
  
  <pre class="lang-none prettyprint-override"><code>http://www.sample.com/en-us/test.aspx?q=keyword&amp;flag=value
  </code></pre>
  
  <p>How can I create a rule to implement this?</p>
  
  <p>I've tested the following rule, but no luck, it always got redirect loop error:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;rewrite&gt;
      &lt;rules&gt;
          &lt;rule name="test" stopProcessing="true"&gt;
              &lt;match url="(.*)/test\.aspx(.(?!flag=value))*$" /&gt;
              &lt;action type="Redirect" url="{R:0}&amp;amp;flag=value" appendQueryString="false" logRewrittenUrl="true" /&gt;
          &lt;/rule&gt;
      &lt;/rules&gt;
  &lt;/rewrite&gt;
  </code></pre>