Msg#: 4086576 posted 6:38 pm on Feb 24, 2010 (gmt 0)
Today I discovered a totally unexpected behavior when the .htaccess RewriteRule passes an encoded plus sign (%2B) to a query string. For example if you take and urlencode the URI "/foo/widget 2+.html" you get "/foo/widget+2%2B.html". Now take this URI and pass it to a querystring via the following RewriteRule:
Msg#: 4086576 posted 7:03 pm on Feb 24, 2010 (gmt 0)
Thinking more on this issue. I think what is really happening is that Apache is decoding the string as the RightRule passes it over to the query string. Thus using urldecode() becomes redundant, thus the plus sign disappears. So unless someone does what I do and bury the urldecode instruction in a larger custom function for cleaning variables they could simply use $foo straight without using urldecode.
In my case since I use a separate multi-use function to sanitize encoded such strings I have to parse the REQUEST_URI as I described at the end of my post above.