title: Rewrite Query String
body: <p>I have this URL:</p>
  
  <pre>oldsite.com/profile.php?uid=10</pre>
  
  <p>I would like to rewrite it to:</p>
  
  <pre>newsite.com/utenti/10</pre>
  
  <p>How can I do that?</p>
  
  <p><strong>UPDATE</strong>: I wrote this:</p>
  
  <pre>RewriteCond %{QUERY_STRING} ^uid=([0-9]+)$
  RewriteRule ^profile\.php$ http://www.newsite.com/utenti/$1 [R=301,L]</pre>
  
  <p>But $1 match the full query string and not just the user id.</p>