You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Brian Behlendorf <br...@organic.com> on 1996/06/18 08:43:06 UTC

inneresting behavior

I have a CGI script at http://bong.com/~brian/aptest/redirect.cgi.  The
only thing this CGI script does is output the line

  Location: /~brian/aptest/index.html

This triggers Apache to do an internal redirect to the actual file, and
serve that out, as per the CGI specification.  If I give a complete URL, a
la 

  Location: http://bong.com/~brian/aptest/index.html

This will issue a 302 redirect to the client.  Okay, this is all fine, and
I believe in the spirit of the CGI spec, but I have to wonder - in the
first case, how does the client know that the URL for the returned object
is *different* than the URL in the request?  The browser has in its
URL-display-area "http://bong.com/~brian/aptest/redirect.cgi", even though
the object is really "http://bong.com/~brian/aptest/index.html".  I don't
see any Base: header being returned in the response, nor any insertion of
a <BASE> tag in the HTML (I wouldn't expect the latter).  Is this a
desired behavior?

I got into this because someone at work pointed out that the CGI pages at
hoohoo.ncsa.uiuc.edu had the Location: headers with only URL fragments,
not the complete URL (http://hoohoo.ncsa.uiuc.edu/cgi/out.html).

	Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS