title: Rewrite URL with .htaccess for multiple parameters
body: <p>This question might be a duplicate. But I did not find any solution worked for me.
  I want to rewrite URL, where I have one and two level parameters. first parameter is <code>p</code> and second is <code>sp</code></p>
  
  <p><code>www.domain.com/home</code> should point to <code>www.domain.com/index.php?p=home</code>
  and
  <code>www.domain.com/projects/99</code> should point to <code>www.domain.com/index.php?p=projects&amp;sp=99</code></p>
  
  <p>How do I do in .htaccess?</p>
  
  <p>Currently My htaccess is as followes,</p>
  
  <pre><code>RewriteEngine on
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?p=$1
  RewriteRule ^([^/]*)/([^/]*)\$ index.php?p=$1&amp;sp=$2 [L]
  </code></pre>
  
  <p>The problem with this htaccess is that it correctly points one level url. ie., www.domain.com/home. But not the two level url. ie. www.domain.com/projects/99</p>