All output written by the CGI program to STDOUT is taken by the server to process. The output should start with a header in one of three types:
-
Location: the server sends another file to the client (and terminates connection).
-
print "Location: http://www.some.box.com/the_other_file.html";
-
Status: The server will return a status message to the client (and terminates connection).
-
print "Status: 305 Document moved\n";
-
Content-type: The server sends all remaining output to the client (after the mandatory blank line!), terminating only when the script does.
-
print "Content-type: text/html\n\n";
|