It's not just me — many colleagues, even English-speaking ones (although for them it's quite rare), have run into the mod_rewrite (rewrite engine) problem where it flatly refuses to accept strings containing "%", even though it supposedly should. So, as long as our URL string contains only standard, of course English, characters - everything's great. But as soon as mod_rewrite encounters an encoded string in its path - anything starting with the "%" sign simply doesn't exist for it.
Unfortunately, the creators of Apache (since this module was, after all, contributed to them) don't bother fixing this obvious bug, so for now you have to work around it (and this isn't always even possible) by making the URL look worse.
So, to get mod_rewrite to actually accept an escaped string containing % characters, you'll have to escape that string TWICE!
Normal PHP example:
$url = urlencode('это моя строка');
Example of what's needed for mod_rewrite:
$url = urlencode(urlencode('это моя строка'));
The same applies to other languages. And this all works fine as long as you're not simply trying to submit data through a form (via submit) - the browser, without any extra steps, for example via Javascript, won't double-escape the string on its own.
Applies to: Apache 2.2.16 and below (possibly above as well)
Comments