Re: redirects and relative URLs

Henry asked:
> If I dereference a URL which contains a redirect to another resource, and that
> resource contains relative URLs, how should the relative URLs of the returned
> document be completed? With the initial URL? Or with the one given in the Location
> header (or some other header?) of the last document?
>
> Perhaps this has been written up somewhere?

Doesn't RFC 3986 <http://www.ietf.org/rfc/rfc3986.txt> speak to this?

5.1.3.  Base URI from the Retrieval URI

If no base URI is embedded and the representation is not encapsulated
within some other entity, then, if a URI was used to retrieve the
representation, that URI shall be considered the base URI.  Note that
if the retrieval was the result of a redirected request, the last URI
used (i.e., the URI that resulted in the actual retrieval of the
representation) is the base URI.


-- 
John S. Erickson, Ph.D.
Director, Web Science Operations
Tetherless World Constellation (RPI)
<http://tw.rpi.edu> <olyerickson@gmail.com>
Twitter & Skype: olyerickson

Received on Sunday, 29 January 2012 13:03:49 UTC