title: Mod_Rewrite: Insert "/" between variables and values in URL
body: <p>I am attempting clean useful URLs using mod_rewrite. I am sure this is a common question but I am not so hot with mod_rewrite:</p>
  
  <p>I have this URL: <a href="http://mysite.com/user.php?user=fatcatmat&amp;sort=popularv" rel="nofollow noreferrer">http://mysite.com/user.php?user=fatcatmat&amp;sort=popularv</a></p>
  
  <p>I want to be able to rewrite it like this:</p>
  
  <p><a href="http://mysite.com/user/user/fatcatmat/sort/popularv" rel="nofollow noreferrer">http://mysite.com/user/user/fatcatmat/sort/popularv</a> 
  <em>(Is there a way to remove duplicates in a URL?)</em></p>
  
  <p>I think I have managed to do the removal of the PHP extension.</p>
  
  <pre><code>RewriteRule ^(.*)\$ $1.php [nc]
  </code></pre>
  
  <p>Is the above correct?</p>
  
  <p>For the separate pages, I would have something like this.</p>
  
  <pre><code>RewriteRule ^/?user(/)?$ user.php
  </code></pre>
  
  <p><strong>Main Question</strong>: Its a bit tedious to do all the above but is there a MEGA rewrite rule that will just place "/" in between variables and their values and remove the .php extension from all pages?</p>
  
  <p>Thank you for any help.</p>