title: Rewrite Rule using map AND stripping certain parameters
body: <p>I'm pretty new to all this so please be basic in your explanations.</p>
  
  <p>The place I work just changed store software so I have a series of URLS that need massaging as Google, people, etc continue to use the old links.</p>
  
  <p>The old links look like:
  <a href="http://mydoman/usedateb.aspx?User_ID=38482&amp;Category_ID=127" rel="nofollow">http://mydoman/usedateb.aspx?User_ID=38482&amp;Category_ID=127</a></p>
  
  <p>I know how to do a rewrite map to change
  <a href="http://mydomain/usedateb.aspx?Category_ID=127" rel="nofollow">http://mydomain/usedateb.aspx?Category_ID=127</a>
  to
  <a href="http://mydomain/hoopy-new-tour-name.aspx" rel="nofollow">http://mydomain/hoopy-new-tour-name.aspx</a></p>
  
  <p>And I know how to do a rewrite rule to remove the User_ID=xxx&amp; from the Url.</p>
  
  <p>My problem is in getting them both to work together.  I need to take out the User_ID (since it's arbitrarily assigned) AND send it through the map to change to the hoopy-new-tour-name.</p>
  
  <p>I have set up the rewrite rule to remove User at the top of the list and the rewrite map rule lower in the list but I end up at <a href="http://mydomain/usedateb.aspx?User_ID=38482&amp;Category_ID=127" rel="nofollow">http://mydomain/usedateb.aspx?User_ID=38482&amp;Category_ID=127</a></p>
  
  <p>If it helps, my web.config has lines like</p>
  
  <pre><code>&lt;add key="UseDateB.aspx?Category_ID=127" value="/success.htm" /&gt;
  </code></pre>
  
  <p>for the map and </p>
  
  <pre><code>&lt;rule name="Remove extra parameters - UserID"&gt;
        &lt;match url="(.*)User_ID=([0-9]+&amp;amp;)(.*)" /&gt;
        &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false" /&gt;
        &lt;action type="Rewrite" url="{R:1}{R:3}" appendQueryString="false" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>to strip the unwanted parameter.</p>
  
  <p>The reason I need the map is that Cat 127 may be the hoopy tour but 128 may be the frood tour.  There's a list of about 500 of these that need remapping but we gotta get the extra parameter off the incoming URLs for it to work.</p>
  
  <p>All help appreciated!  If I'm going about it completely wrong please let me know that too.</p>