Location
The Location response header field defines the exact location of the resource that was identified by the request URI. If the value is a full URL, the server returns a "redirect" to the client to retrieve the specified object directly.
Location: http://www.csd.uoc.gr/~hy556/notes/HTTP/index.html
If you want to reference another file on your own server, you should output a partial URL, such as the following:
Location: /~hy556/notes/HTTP/index.html
The server will act as if the client had not requested your script, but instead requested http://yourserver/~hy556/notes/HTTP/index.html. It will take care of all access control, determining the file's type, etc.. In this case clients don't do the redirection, but the server does it "on the fly". Important: Only full URLs in Location field can contain the #label part of URL (i.e. fragment), because that is meant only for the client-side, and the server cannot possibly handle it in any way.
As an example of actual use, suppose that the "Ask Dr. Marazakis" form has a Yes/No toggle after the question "Did you search the site and read the HTTP tutorial?". The default is No, so if the user doesn't reset this to Yes they will simply be redirected to the HTTP tutorial and their question will not be sent. A simple example in Perl (inside a CGI script), is the following:
if ($input{'YN'} eq "No") {
print "Location: http://www.csd.uoc.gr/~hy556/notes/HTTP/index.html\r\n";
}
else {
print "Content-Type: text/html\r\n";
&Feedback;
}