2
(Wow, that title sucks... Feel free to make a suggestion in comments or edit it if you have a better one.)
I have a server with a CGI program which receives a URL as pathinfo, checks the user's IP address, and redirects them to either go directly to that URL (if they're internal to our organization) or send them to the URL via a proxy (if they're external). The CGI itself works great, but there are some URLs for which apache returns a 404 Not Found error instead of invoking the script. It appears that this is related to the destination URL containing a URI-encoded path. e.g.,
http://myserver.org/cgi-bin/ipchk/http://other.server.org/10.1007%2F3-540-28519-9_8
returns 404, while
http://myserver.org/cgi-bin/ipchk/http://other.server.org/10.1007/3-540-28519-9_8
(the same URL, but with the %2F
decoded to a /
) works properly.
I have verified (by outputting to error_log
on startup) that, when 404 is returned, the ipchk
script is not being started at all. These errors are definitely coming from apache itself and not resulting from the script redirecting users to a nonexistent URL.
Why would the encoding of the pathinfo-URL affect apache's ability to locate the ipchk script and what do I need to do to get it to pass all /cgi-bin/ipchk/
URIs to ipchk
regardless of what may follow?