Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect based on referer

Status
Not open for further replies.

crazyboybert

Programmer
Jun 27, 2001
798
GB
Hi All

I am not particularly familiar with Perl so am sorry if this has been covered before etc. I have made a keyword search but to no avail.

I need a script to redirect a webpage based on the referer. Or more specifically I have one domain (lets say domainA) bring redirected to another (say domainB) and i want all users who coem to domainB from domainA to be redirected to the page
This in itself seems fairly simple stuff. Certainly using PHP this would require just one line of code on the index page of domainB.

I am aware of the server info variable $HTTP_REFERER in Perl so presume something along the lines of

if($HTTP_REFERER eq ' print "Location: }

In a PHP page I could just include this code on the page and Voila. Can I do the same with Perl? Or do i need to run a CGI which will determine where to send people based on where they have come from?

Thanks in advance for any help provided.

Rob ------------------------------------

Go placidly amidst the noise and haste,
find what peace there may be in silence.
-Anon

------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top