IIS URL Redirect change querystring parameter name
<p>I am trying to redirect from one site to another like the following.</p>

<pre><code>http://example.com/quickscan/?code=123456 
</code></pre>

<p>To</p>

<pre><code>https://example2.com/as-quickscan/login?username=123456
</code></pre>

<blockquote>
  <p>The domains are different. Also the redirect URL parameter and URL structure is entirely different.</p>
</blockquote>

<p>What I have tried is the following and some other variations.</p>

<pre><code>&lt;rule name="Redirect quickscan" stopProcessing="true"&gt;
  &lt;match url="^quickscan/\?[a-zA-Z]+=([0-9]+)?$" ignoreCase="true" /&gt;
  &lt;action type="Redirect" url="https://example2.com/as-quickscan/login?username={R:1}" appendQueryString="false"/&gt;
&lt;/rule&gt;
</code></pre>



<pre><code>&lt;rule name="Redirect quickscan" stopProcessing="true"&gt;
    &lt;match url="^(.*)$" ignoreCase="false" /&gt;
    &lt;conditions&gt;
        &lt;add input="{QUERY_STRING}" pattern="^quickscan/\?[a-zA-Z]+?=([0-9]+)?$" /&gt;
    &lt;/conditions&gt;
    &lt;action type="Redirect" url="https://example2.com/as-quickscan/login?username={R:1}" redirectType="Permanent" appendQueryString="false" /&gt;
&lt;/rule&gt;
</code></pre>