title: RewriteCond for url with parameters
body: <p>I've got a problem to rewrite an url.
  I want this :</p>
  
  <pre><code>http://www.foo.com/test.php?u=s1&amp;id=12345&amp;img=12
  </code></pre>
  
  <p>to</p>
  
  <pre><code>http://app.foo.com/12345-s1-12.test
  </code></pre>
  
  <p>First parameter u is a string, parameters id and img are integers.</p>
  
  <p>I've started with something like that :</p>
  
  <pre><code>RewriteCond %{REQUEST_URI} ^/test.php?u=(.*)&amp;id=(.*)&amp;img=(.*)/ [NC]
  RewriteRule (.*) http://app.foo.com/%2-%1-%3.test [QSA,R=301,L]
  </code></pre>
  
  <p>Thanks :)</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>Still doesn't work but i'm close!</p>
  
  <pre><code>RewriteCond %{REQUEST_URI} ^/test.php [NC]
  RewriteCond %{QUERY_STRING} ^u=(.*)&amp;id=(.*)&amp;img=(.*)
  RewriteRule (.*) http://app.foo.com/%2-%1-%3.test [QSA,R=301,L]
  </code></pre>
  
  <p>Now it give me that link :</p>
  
  <pre><code>http://app.foo.com/12345-s1-12.test?u=s1&amp;id=12345&amp;img=12
  </code></pre>
  
  <p>Instead of :</p>
  
  <pre><code>http://app.foo.com/12345-s1-12.test
  </code></pre>
  
  <p>:(</p>