durusmail: qp: Publisher.complete_url(), and running behind a script
Publisher.complete_url(), and running behind a script
2007-01-24
2007-01-24
2007-01-25
Publisher.complete_url(), and running behind a script
David Binger
2007-01-24
On Jan 24, 2007, at 7:18 AM, mario ruggier wrote:

> Hi,
>
> stumbled onto this issue on a site running behind a cgi script
> instead of mod_scgi.
>
> Given my url path is something like "/app.cgi/component",
> then doing publisher.redirect("/app.cgi/component")
> will send to the location "/app.cgi/app.cgi/component".

I think that is the correct behavior.  The redirect should
be to /component if you want the redirect response's location
header to be /app.cgi/component.  This allows the application
to operate without changes, even if the SCRIPT_NAME changes.

Within the application, you should use redirect as if the
application were running at the root of the url space.
If you need urls for generated javascript or css, you should
call complete_url() or build the path directly using
get_script_name().

This has always been a confusing issue, here and in
Quixote history.



reply