This is the first time I came across this thing, and I’ve been working with Apache for about 13 years now.
I have this rewrite rule:
RewriteRule ^/tagged/(.*)/$ /index.php?a=tagged&tags=$1
Very simple, right?
Here is the deal: if the value of the “tag” contains urlencoded chars – they are just lost in translation. Gone, bye-bye!?
If I enter url like this: /tagged/c%2B%2B/ which is the wight way to urlencode c++
then index.php receives the value of tags=c
where did my ++ go?
When I enter c%2B%2B directly in the url like this:
/index.php?a=tagged&tags=c%2B%2B then everything if fine, happily finding my posts tagged c++
Is this a known issue? What’s the workaround?
I had a problem very similar to this once. Here is the link I used to solve it. The issue is that, as the link suggests, by the time mod_rewrite performs its rules Apache has already unescaped the URL and so when you rewrite the URL to the PHP script, PHP will interpret the +’s as spaces.
Edit: the post has been updated: