On Fri, 2004-08-13 at 11:52 -0400, John Belmonte wrote: > Shahms King wrote: > > I agree that messing with SCRIPT_NAME and PATH_INFO is unpleasant and > > I'd like a better solution, I'm just not sure one is possible given > > current mod_python and Apache. > > Attached are my functions for deriving from REQUEST_URI. They seem > simple enough, but perhaps the output is different than what you need. > > -John I tried something like this originally, and it solves some of the problems, but not all of them. In fact, I'm pretty sure it only works for URL rewriting because for every "standard" request REQUEST_URI equals SCRIPT_NAME + PATH_INFO + QUERY_STRING. Which ends up not solving any of the problems mentioned in my previous email. For those cases, simply removing PATH_INFO and QUERY_STRING results in the exact same SCRIPT_NAME as was originally used. The main issue is that the information contained in SCRIPT_NAME and PATH_INFO (as dictated by CGI/1.1) are not the information actually needed to process the request. For file-based scripts (PHP and regular CGI) it works fine, but for handler-based scripts it breaks down. SCRIPT_NAME should be the part of the path that "triggered" invoking the script when it actually contains one component beyond the end of the path that exists as directories in the filesystem. You can see how for file-based scripts this is a one-to-one match (unless you're using Reiser 4 ;-P), but for any handlers that can be based on an arbitrary directory structure, it doesn't exactly work. I'll see what happens if I take this discussion up on the Apache and mod_python mailing lists, because it's not just a Quixote problem. The mod_mono people have run into similar problems. -- Shahms E. KingMultnomah ESD Public Key: http://shahms.mesd.k12.or.us/~sking/shahms.asc Fingerprint: 1612 054B CE92 8770 F1EA AB1B FEAB 3636 45B2 D75B
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBBHO8H/qs2NkWy11sRAobvAJ9VPNUvMpRfffVzRDGgN2dOQUe7FQCfWG6n D3rJ2PueSLqlYg3P/60VUz0= =AgxQ -----END PGP SIGNATURE-----