I ran into an unexpected case of
Apache giving me a 404 error instead of letting mod_rewrite handle the path, when one of
the percent-encoded path parts was itself a HTTP
URL.
e.g. "GET
/myfolder/http%3A%2F%2Flocalhost%2Fnotify
HTTP/1.0"
I have an extremely simple rule in the
/myfolder/.htaccess file which sends everything that's not a file
in /myfolder/ to a script. It works fine with other percent-encoded values, but in this
case Apache never processes the RewriteRule from the .htaccess file. I can double-encode
the value as a workaround, but it seems that Apache should still process the mod_rewrite
phases. I intend the URL merely to be an input parameter to the
script.
Here are the (ir)relevant
mod_rewrite directives in
/myfolder/.htaccess:
RewriteCond
%{REQUEST_FILENAME} !-s
RewriteRule .*
./script-the-world.php
The
rewrite rules are NOT being processed. In the server configuration I've got
RewriteLogLevel 5, etc., and tail -f /var/log/http/rewrite.log shows all my requests to
/myfolder/ being rewritten... except for the one mentioned above. I mean to say that
something internal is happening in the special case above, but I have no clue what it
is. I'm hoping someone might know of another module that is interfering with what I'm
trying to accomplish.
This is Apache
2.2.16.
Comments
Post a Comment