title: URL Rewriting to subfolders based on the parameters
body: <p>Is it possible to Rewrite the URL to different sub folders based on the parameters passed in URL? i found the <a href="https://stackoverflow.com/questions/24286584/how-to-rewrite-main-domain-to-sub-folder-without-changing-url">Question1</a> and <a href="https://stackoverflow.com/questions/14303192/how-to-change-below-rewrite-url-to-allow-more-sub-folder-when-all-url-redirecte">Qestion2</a> but they are not applicable on my example. Consider the following situation</p>
  
  <pre><code>www.mywebsite.com/about/overview 
  </code></pre>
  
  <p>rewrites to </p>
  
  <pre><code>www.mywebsite.com/about/index.php?a=overview
  </code></pre>
  
  <p>Similarly </p>
  
  <pre><code>www.mywebsite.com/contact-us/office 
  </code></pre>
  
  <p>rewrites to </p>
  
  <pre><code>www.mywebsite.com/contact-us/index.php?a=office 
  </code></pre>
  
  <p>or</p>
  
  <pre><code>www.mywebsite.com/contact-us/home 
  </code></pre>
  
  <p>rewrites to </p>
  
  <pre><code>www.mywebsite.com/contact-us/index.php?a=home
  </code></pre>