Creating a redirect page in Perl is a little like doing so in HTML. A redirect page is a page that redirects a user to another page once the user enters.

A CGI based redirect page is required whenever the original page to be redirected from is a CGI document. No JavaScript or HTML code will do, since CGI documents are interpreted by the server, and requires actual CGI codes in them.

To create a CGI redirect page, open a text editor and add the following lines of code:

#!/usr/bin/perl

print “Location: http://redirectmehere.com/newfileredirect.pl\n\n”;

Replace the ‘redirectmehere/newfileredirect.pl” portion of the code to match the place you would like your users redirected to. Do make sure to replace #!/usr/bin/perl with the correct path to your Perl interpreter on your server or the code will not work. The one used in this example is the most commonly used location for the interpretor so you should be fine. If you need help with any of the above, please contact Webhostpython and we will be more than happy to help you.

Thank you