HTTP/1.1 200 OK Location: /hello
Actually, this probably won't work; it should be a 30x status, not 200 ("303 See" Other "is best suited for a POST response), and" Location should be a complete, absolute URL. "
(If your script just says βLocation: / relativeurl without 30x status, CGI servers usually do an internal redirect by picking a new URL and returning it without telling the browser anything funny. It may sound like you want, but in reality in fact, this is not so, because from the point of view of the browser, it is no different from the original script returning 200 and the direct page.)
But this will cause a redirect, the browser will again request a url / hello.
In practice, this is probably not as bad as you think thanks to HTTP / 1.1 keep-alives. The client should be able to immediately respond to the redirection (in the next packet) if it is on the same server.
Is there a way [...] This will tell the browser to request / hello / 1 when I hit F5 (update) instead, after sending a warning?
Nope. Stick to the POST-Redirect-GET model to solve this problem.
bobince
source share