title: Rewriting URL with selected query string parameters in .htaccess
body: <p>I recently changed my CMS, and want to rewrite some of my URLs to match the new URL/query string parameter format.</p>
  
  <p>The old URL was:</p>
  
  <pre><code>http://www.mysite.com/search.cgi?tag=foo&amp;blog_id=bar&amp;other=baz
  </code></pre>
  
  <p>The new URL should be:</p>
  
  <pre><code>http://www.mysite.com/?s=foo
  </code></pre>
  
  <p>In other words, there were several query string parameters in the old format, but I only care to rewrite the <strong>tag</strong> param to <strong>s</strong> while keeping the same value.  The other parameters should be discarded.  Of course the order of the parameters shouldn't matter.  It also shouldn't matter whether tag is the only parameter or not.</p>
  
  <p>Any ideas?</p>