[Web-SIG] Internal redirect using Location with absolute path and status of 200.

Graham Dumpleton graham.dumpleton at gmail.com
Thu May 24 06:43:36 CEST 2007

The CGI specification allows for a CGI script to return a 'Location'
header which refers to a location within the local web server. Quoting
the RFC:

"""If the Location value is a path, then the server will generate the
response that it would have produced in response to a request
containing the URL"""

In Apache this is honoured when the Status returned by the CGI script
is also 200. The end result is that rather than sending a redirect
back to the web client, Apache will trigger a new sub request against
the path (as a GET request) and return the result of that to the web

Although the WSGI specification doesn't mention any requirement for a
WSGI adapter for a web server to do the same thing, it may be an
interesting thing to consider for a future version of the WSGI

Does anyone know of any WSGI adapter which currently implements this,
besides CGI/WSGI adapters which by virtue of CGI specification should
implement it?

Has anyone used this convention internal to a WSGI stack as a means of
performing local redirection, thereby avoiding forcing the client to
do the redirect?

Does anyone think this would be nice extension for a WSGI adapter
written against current specification to implement even if not
necessarily portable?


More information about the Web-SIG mailing list