How to redirect url with perl script

It is common scenario when you need to tell the browser to redirect or look elsewhere for a page because you don’t want to produce a document yourself.

For example should redirect to a page/url

Here is perl code to redirect web page to

However this code misses the functionality to get URL as input, this can be easily done using standard CGI module. Please see script code.

i) Just download the rd.tar.gz script (click on download) or use wget command at shell prompt:
$ wget

ii) Copy script to your cgi-bin directory or directory where perl script execution allowed
iii) Suppose your domain name is and you put this script in directory called cgi-bin then to execute this script simply type or even ftp url

Author: admin

I like chocolate, gadgets, open source software, photography, traveling and all shades of green colors. I love spending time with fun loving friends and family members. This is my own online journal.

4 thoughts on “How to redirect url with perl script”

Leave a Reply

Your email address will not be published. Required fields are marked *