CGI Programming / Scripts Question: Download CGI Programming PDF

Can I redirect users to another page?

Tweet Share WhatsApp

Answer:

For permanent and simple redirection, use the HTTPD configuration file:
it is much more efficient than doing it yourself. Some servers enable
you to do this using a file in your own directory (eg Apache) whereas
others use a single configuration file (eg CERN).

For more complicated cases (eg process form inputs and conditionally
redirect the user), use the "Location:" response header.
If the redirection is itself a CGI script, it is easy to URLencode
parameters to it in a GET request, but dont forget to escape the URL!

Download CGI Programming PDF Read All 27 CGI Programming Questions
Previous QuestionNext Question
How do I launch a program (.exe) that is located on the Server from a Web page?Is it possible to set a cookie and then redirect a return visitor to a different url all using cgi?