Quoting David Binger: > Perhaps your web server is providing the correct SCRIPT_NAME, > and the problem is introduced in Publisher.process(), which attempts > to work around a common, similar SCRIPT_NAME/PATH_INFO problem in > a way that would make matters worse for your setup. This one is Apache/2.0.49 on a Suze linux box. Thanks for pointing me to Publisher.process() (should have read the source code better ;-). Interestingly though, it seems to get it all wrong for the special case here, as when the cgi script is requested without any trailing slash, the incoming env to process gives: # location: '/app.cgi' SCRIPT_NAME: '' PATH_INFO: '/app.cgi' # location: '/app.cgi/' SCRIPT_NAME: '/app.cgi' PATH_INFO: '/' > In your case, I think you could try overriding this method and > changing any empty PATH_INFO to "/" and removing the "if" statement that > appears above. OK, i tried this instead of what I had on _q_traverse() before: def process (self, stdin, env): print env.get('SCRIPT_NAME'), ':', env.get('PATH_INFO') if env.get('SCRIPT_FILENAME'): if not env.get('SCRIPT_NAME'): if env.get('SCRIPT_FILENAME').endswith(env.get('PATH_INFO')): # self.redirect(env.get('PATH_INFO') + '/') env['SCRIPT_NAME'] = env.get('PATH_INFO') env['PATH_INFO'] = '/' return super(Publisher, self).process(stdin, env) which works fine, except for the one detail (can live with it) that the displayed url remains the unslashed. I would prefer to redirect, so that the correct url is what is always shown. However, respond_now exceptions are unhandled here, so I cannot call redirect() from here... > Even easier, perhaps, would be to put a redirect in your web server > config > so that '/app.cgi' always redirects to '/app.cgi/' before qp sees it. Yes, this would be the cleanest, and most performant. But while in this case I actually can negotiate modifying the httpd conf, I'd rather keep the site deployable more easily -- it may be moved, other people may modify the conf, etc. Actually, if I was in comfortable control over the server conf, I would not use to deploy as cgi in the first place. The check itself is about the same as before, but I guess putting this on process() has the advantage of collecting these env fixes in a same logical place. Thanks, mario