I discovered a bug in my system, which I traced back to Apache's mod_rewrite.
I hacked together a workaround for myself, and want to mention it here because I guess this forum has higher visibility than the issues list... and you guys might know if:
- this is really a general bug in mod_rewrite or not; (I'm not an Apache (or PHP/Drupal) wizard)
- a workaround should (not) be created in Drupal, and it should (not) be done in the way I did it...
(I'll create an issue accordingly, afterwards.)
My issue is: I'm using special characters '/' and '&' in some URLs, and my mod_rewrite (apache 1.3.29) cannot cope with them.
The specific situation is, I'm using the article module, and some article categories contain a '&'. A link to the category 'this & that' translates to an URL
'http://SITE/article/this+%36+that'
However,
- mod_rewrite screws up, translating the '%36' back to '&' (at least, I think so, because $_GET["q"] just contains 'article/this ')
- if mod_rewrite encounters a '%2F' in the URL, it just throws a 404 immediately. (I saw this mentioned as a mod_rewrite bug somewhere when Googling, too.)
My solution is to patch common.inc like below...
This will just force an 'unclean version' of the URL whenever it encounters a %36 or %2F.
Is this good for Drupal core?
Or should there be a third option for Clean URLs ('clean except when special chars used') which enables this?
Or is there a better way to achieve this?
Or should Drupal not care at all (because my config is just stupid and normal Apache's don't have this problem)?