title: Rewrite rule in htaccess to keep parameters
body: <p>I've written the following rewrite rule which works fine when no parameters (no page numbers, no products per page, no sort order etc)</p>
  
  <pre><code>RewriteRule ^(?!bench/).*cat_2.html(\.[a-z]{3,4})?(.*)  "http\:\/\/www\.mysite\.co\.uk\/bench\/cat_2\.html\?mode\=allBrands" [R=301,L]
  </code></pre>
  
  <p>This makes sure the URL is optimized on Googles results.  So </p>
  
  <ul>
  <li><a href="http://www.mysite.co.uk/bench-clothing/cat_2.html?mode=allBrands#" rel="nofollow">http://www.mysite.co.uk/bench-clothing/cat_2.html?mode=allBrands#</a></li>
  </ul>
  
  <p>gets changed to </p>
  
  <ul>
  <li><a href="http://www.mysite.co.uk/bench/cat_2.html?mode=allBrands" rel="nofollow">http://www.mysite.co.uk/bench/cat_2.html?mode=allBrands</a></li>
  </ul>
  
  <p><code>mode=allBrands</code> will always be set.</p>
  
  <p>So if i click on a link to go to </p>
  
  <ul>
  <li><a href="http://www.mysite.co.uk/bench-clothing/cat_2.html?mode=allBrands&amp;ppp=64&amp;sort=desc&amp;page=2" rel="nofollow">http://www.mysite.co.uk/bench-clothing/cat_2.html?mode=allBrands&amp;ppp=64&amp;sort=desc&amp;page=2</a></li>
  </ul>
  
  <p>it gets redirected to </p>
  
  <ul>
  <li><a href="http://www.mysite.co.uk/bench/cat_2.html?mode=allBrands" rel="nofollow">http://www.mysite.co.uk/bench/cat_2.html?mode=allBrands</a></li>
  </ul>
  
  <p>which is the first page.</p>
  
  <p>Any help would be great.</p>