title: How to rewrite domainname.com/index.php/dir/controller/?var1=abc&var2=def
body: <p>How to rewrite <code>domainname.com/index.php/dir/controller/?var1=abc&amp;var2=def</code></p>
  
  <p>to </p>
  
  <p><code>domainname.com/rewrite-string/abc/def/</code>?</p>
  
  <p><code>domainname.com/rewrite-string/abc/def/</code> is link that user put to browser address bar </p>
  
  <p>and server will redirect it to <code>domainname.com/index.php/dir/controller/?var1=abc&amp;var2=def</code>.</p>