title: .htaccess rewrite rules for multiple parameters
body: <p>Rewriting the following 3 URLs</p>
  
  <p><code>http://example.com/index.php?page=search</code>
  to 
  <code>http://example.com/search</code></p>
  
  <p><code>http://example.com/index.php?page=profile&amp;value=myname</code>
  to 
  <code>http://example.com/myname</code></p>
  
  <p><code>http://example.com/index.php?page=stats&amp;type=daily</code>
  to 
  <code>http://example.com/stats/daily</code></p>
  
  <p>Current .htaccess is written as the following:</p>
  
  <pre><code>Options -MultiViews
  RewriteEngine On
  RewriteBase /
  
  RewriteCond %{THE_REQUEST} /index\.php\?page=([^\s&amp;]+)&amp;value=([^\s&amp;]+) [NC]
  RewriteRule ^ index/%1/%2? [R=302,L,NE]
  
  RewriteCond %{THE_REQUEST} /index\.php\?page=([^\s&amp;]+)&amp;type=([^\s&amp;]+) [NC]
  RewriteRule ^ index/%1/%2? [R=302,L,NE]
  
  RewriteCond %{THE_REQUEST} /index\.php\?page=([^\s&amp;]+) [NC]
  RewriteRule ^ index/%1/? [R=302,L,NE]
  
  RewriteRule ^index/([^/]+)/([^/]+)/?$ /index.php?page=$1&amp;value=$2 [NC,L,QSA]
  RewriteRule ^index/([^/]+)/([^/]+)/?$ /index.php?page=$1&amp;type=$2 [NC,L,QSA]
  RewriteRule ^index/([^/]+)/?$ /index.php?page=$1 [NC,L,QSA]
  </code></pre>
  
  <p>I need to remove /index/ from the first and third URL, and /index/profile/ from the second one.</p>
  
  <p>All comments &amp; suggestions are welcomed.</p>