title: Rewriting URL that contains multiple parameters with multi-word strings (with mod_rewrite)
body: <p>Was trying to rewrite the URL of a page that has multiple parameters and one of the parameters contains multiple words (separated by spaces when submitted). </p>
  
  <p>This would be the URL: <strong>www.ABCD.com/store/itemsDescr.php?categ=headbands&amp;id=123&amp;name=brown%20with%20black</strong></p>
  
  <p>I would like the URL to show like this:
  www.ABCD.com/store/headbands/123/brown-with-black</p>
  
  <p>I tried this, but it did not work:</p>
  
  <pre><code>RewriteCond %{QUERY_STRING} ^categ=([^&amp;]+) [NC,OR]
  RewriteCond %{QUERY_STRING} &amp;categ=([^&amp;]+) [NC]
  RewriteRule ^store/itemsDescr\.php$ $0/%1
  
  RewriteCond %{QUERY_STRING} ^id=([^&amp;]+) [NC,OR]
  RewriteCond %{QUERY_STRING} &amp;id=([^&amp;]+) [NC]
  RewriteRule ^store/itemsDescr\.php/[^/]+$ $0/%1
  
  RewriteCond %{QUERY_STRING} ^name=([^&amp;]+) [NC,OR]
  RewriteCond %{QUERY_STRING} &amp;name=([^&amp;]+) [NC]
  RewriteRule ^store/itemsDescr\.php/([^/]+/[^/]+)$ http://www.ABCD.com/store/$1/%1/? [L,QSA,NC]
  </code></pre>
  
  <p>Any help would be much appreciated!</p>
  
  <p>NOTE: Before this rule I want to implement, I already have this other rule for another page, in case it can create conflict:</p>
  
  <pre><code>    RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(store)/index\.php\?categ=([^\s]+) [NC]
  RewriteRule ^ /%1/%2? [R=301,L]
  
  RewriteCond %{REQUEST_FILENAME} !-f    
  RewriteRule ^store/(.+?)/?$ /store/index.php?categ=$1 [L,QSA,NC]
  </code></pre>