I want to redirect a certain URI to a new one on the same server. This can be done by sending a response with a 3xx code, and a 'Location' header. Now the HTTP/1.1 standard dictates that this should be an 'absolute URI'. (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30)
Now what exactly do they mean by 'absolute URI'? In the example given they included the full URI, with protocol, hostname, and the path. Now I want to redirect to a URI on the same server, and I know the path. It is an absolute URI (it starts at the root), but without hostname and protocol. As a matter of fact, the server might not know its own hostname, and it would be hard to construct a full URI.
Is it also valid, according to the HTTP/1.1 standard, to send a URI without hostname and protocol? I tried this, and every browser I tested seemed to understand it. My question is: is it correct to do this?
An example response:
HTTP/1.1 303 See Other
Location: /path/to/other
Instead of:
HTTP/1.1 303 See Other
Location: https://hostname.com/path/to/other