title: Passing URL as parameter using mod_rewrite
body: <p>I would like to rewrite dynamic URL</p>
  
  <p><code>/index.php?pid=login&amp;redirect=/previous-page.html</code></p>
  
  <p>to something like this</p>
  
  <p><code>/login.html-r-previous-page.html</code></p>
  
  <p>I tried this</p>
  
  <pre><code>RewriteRule ^login.html-r-(.*)$ /index.php?pid=login&amp;redirect=$1 [L]
  </code></pre>
  
  <p>But no succes. I was also trying to change the regex to .+ or some other forms, but it seems useless. Maybe I am making mistake somewhere else. </p>
  
  <p>I am new to regular expressions and also mod_rewrite.</p>
  
  <p>Thank you for help</p>