title: htaccess rewrite querystring and remove empty value
body: <p>first, sorry for my bad English.</p>
  
  <p>I try to rewrite url generated from Form Get and redirect that.</p>
  
  <p>my url is like this:</p>
  
  <pre><code>http://www.mysite.com/properties?action=search&amp;agreement=for-rent&amp;category=my-category&amp;type=&amp;zone=my-zone&amp;city=my-city
  </code></pre>
  
  <p>and I have this .htaccess configured:</p>
  
  <pre><code>11. RewriteCond %{QUERY_STRING} ^action=(?:[a-zA-Z\-]*)&amp;(?:.*)=([a-zA-Z\-]*)&amp;(?:.*)=([a-zA-Z\-]*)&amp;(?:.*)=([a-zA-Z\-]*)&amp;(?:.*)=([a-zA-Z\-]*)&amp;(?:.*)=([a-zA-Z\-]*)$
  12. RewriteRule (.*) %{REQUEST_URI}/%1/%2/%3/%4/%5/? [R=301,L]
  </code></pre>
  
  <p>So basically all my request are direct to index.php.</p>
  
  <pre><code>21. RewriteCond %{REQUEST_URI} !index\.php|resources|hidden
  22. RewriteRule ^(.*)$ index.php/$1 [L]
  </code></pre>
  
  <p>All works, but the problem is when I have an empty value in query string, the rule add double slash and the above url (for example whit &amp;type=&amp;zone=my-zone... type have empty value) will translate like that:</p>
  
  <pre><code>http://www.mysite.com/for-rent/my-category//my-zone/my-city/
  </code></pre>
  
  <p>The question is: How can i remove in .htaccess the double slash generated if i have one or more empty value in query string?</p>
  
  <p>Thanks</p>