title: mod_rewrite keep square brackets in URL
body: <p>I'm trying to use mod_rewrite to rewrite a URL but keep the square brackets as it's required by the script to process:</p>
  <pre><code>RewriteRule ^(order|cart)/([0-9]+)/([0-9]+)/?$ /cart?a=add&amp;pid=$2&amp;addons\[$3\] [L,NE]
  </code></pre>
  <p>Unfortunately, the above URL gets translated as follows:
  from: <code>https://example.com/order/1/5</code>  to <code>https://example.com/cart?a=add&amp;pid=1&amp;addons%5B7%5D=</code></p>
  <p>This is what I need as the URL result:
  from <code>https://example.com/order/1/5</code> to <code>https://example.com/cart?a=add&amp;pid=1&amp;addons[5]</code></p>
  <p>I need the square brackets <code>[$3]</code> to stay as square brackets in the URL instead of being changed in mod_rewrite to escaped characters %5B and %5D. No, adding the backslashes does nothing to fix this. I also tried the &quot;B&quot; flag and others.</p>
  <p>Any help?</p>
  <p>Thanks!</p>