It's legitimate for Unix filenames to contain a literal "?". The original submitter of this bug has a patch to add a configuration option to not split on a "?". Could you consider the patch in the URL for application?
Thom May and /me talked about this one a while ago on IRC and came to the conclusion that there's no issue to fix. One can easily use %3F in conclusion with NE option to treat the question mark as part of the name. That is what NE is intended for -- and how URIs *have to* be written.
Hi Andre. I received feedback from this user suggesting that your conclusion is incorrect. Here is the mail he sent me: From: Jade Nicoletti <nicoletti@nns.ch> Hi Matthew It is _not_ possible to use NE and %3F, at least not if I don't want to do a redirect. In the mod_rewrite reference manual, there's an example: RewriteRule /foo/(.*) /bar?arg=P1\%3d$1 [R,NE] This produces a redirect, which leads to a new request, where the new uri is parsed again by apache (core probably, not mod_rewrite) and the %3F is translated to a '?'. But that is not what I am looking for. I don't want a redirect, I don't want a second request to be made. I have something like the following: AddEncoding gzip .gz RewriteEngine On RewriteCond %{HTTP:Accept-Encoding} gzip RewriteRule ^/static/(.+).html$ /static/$1.html.gz [L,nosplit] Where $1 does contain a "%3F", like in http://olwm2003.ch/static/page.php%3Fid=30&lang=en.html I've tried very hard to get a configuration for this without the patch. I've carefully studied the manual and the guide. I've read the source. But I really cound't get it set up without "nosplit". The subject is somewhat complex, but i am very sure that it's not possible without the patch. If I'm wrong, please explain me how it is done the right way. Thank you Jade Nicoletti PS: mod_gzip is slow like a dog. mod_rewrite flies. That's why I'm using it and not mod_gzip.
> RewriteRule /foo/(.*) /bar?arg=P1\%3d$1 [R,NE] Sure it produces a new redirect. Because of the [R] option. What happens without it?
Submitter got back to me with some more information: My working config (using phaethon.ch/static/ for testing purposes): AddEncoding gzip .gz RewriteEngine On RewriteLog "/tmp/rewrite.log" RewriteLogLevel 3 RewriteCond %{HTTP:Accept-Encoding} gzip RewriteRule ^/static/(.+).html$ /static/$1.html.gz [L,nosplit] gives: [phaethon.ch/sid#817517c][rid#818e454/initial] (2) init rewrite engine with requested uri /static/page.php?id=3.html [phaethon.ch/sid#817517c][rid#818e454/initial] (3) applying pattern '^/static/(.+).html$' to uri '/static/page.php?id=3.html' [phaethon.ch/sid#817517c][rid#818e454/initial] (2) rewrite /static/page.php?id=3.html -> /static/page.php?id=3.html.gz [phaethon.ch/sid#817517c][rid#818e454/initial] (2) local path result: /static/page.php?id=3.html.gz [phaethon.ch/sid#817517c][rid#818e454/initial] (2) prefixed with document_root to /home/project/web-site/phaethon/web-files/static/page.php?id=3.html.gz [phaethon.ch/sid#817517c][rid#818e454/initial] (1) go-ahead with /home/project/web-site/phaethon/web-files/static/page.php?id=3.html.gz [OK] your suggested config: RewriteRule ^/static/(.+).html$ /static/$1.html.gz [L,NE] gives (the nonworking result): [phaethon.ch/sid#81aae9c][rid#8187ec4/initial] (2) init rewrite engine with requested uri /static/page.php?id=4.html [phaethon.ch/sid#81aae9c][rid#8187ec4/initial] (3) applying pattern '^/static/(.+).html$' to uri '/static/page.php?id=4.html' [phaethon.ch/sid#81aae9c][rid#8187ec4/initial] (2) rewrite /static/page.php?id=4.html -> /static/page.php?id=4.html.gz [phaethon.ch/sid#81aae9c][rid#8187ec4/initial] (3) split uri=/static/page.php?id=4.html.gz -> uri=/static/page.php, args=id=4.html.gz [phaethon.ch/sid#81aae9c][rid#8187ec4/initial] (2) local path result: /static/page.php [phaethon.ch/sid#81aae9c][rid#8187ec4/initial] (2) prefixed with document_root to /home/project/web-site/phaethon/web-files/static/page.php [phaethon.ch/sid#81aae9c][rid#8187ec4/initial] (1) go-ahead with /home/project/web-site/phaethon/web-files/static/page.php [OK] or did you mean (which works neither): RewriteRule ^/static/(.+)\?(.+).html$ /static/$1\%3F$2.html.gz [L,NE] gives: [phaethon.ch/sid#81ff69c][rid#816dd24/initial] (2) init rewrite engine with requested uri /static/page.php?id=8.html [phaethon.ch/sid#81ff69c][rid#816dd24/initial] (3) applying pattern '^/static/(.+)\?(.+).html$' to uri '/static/page.php?id=8.html' [phaethon.ch/sid#81ff69c][rid#816dd24/initial] (2) rewrite /static/page.php?id=8.html -> /static/page.php%3Fid=8.html.gz [phaethon.ch/sid#81ff69c][rid#816dd24/initial] (2) local path result: /static/page.php%3Fid=8.html.gz [phaethon.ch/sid#81ff69c][rid#816dd24/initial] (2) prefixed with document_root to /home/project/web-site/phaethon/web-files/static/page.php%3Fid=8.html.gz [phaethon.ch/sid#81ff69c][rid#816dd24/initial] (1) go-ahead with /home/project/web-site/phaethon/web-files/static/page.php%3Fid=8.html.gz [OK]
Ok, I'm conviced. It's on my todo. Thanks for your patience with me :)
Has Andre Malo disappeared? The last comment on this bug indicates he accepts this to be a legitimate bug and is working on it. Is this fixed in Apache 2.2? Some form of reason would be helpful, so I can close the Debian bug gracefully.
Please don't add other peoples' addresses to the cc list. This is a minor bug in an obsolete version, so there is no developer time to fix it. If it still exists in 2.2, feel free to refile (or reopen and change the version). You can pass that exact message downstream if you wish. Sorry, but our limited developer resources are much better spent working on bugs known to exist in current versions.