#!/usr/bin/perl print "Content-type: text/html\n\n"; #if the refering agent is dumbdomain.com if ( $ENV{HTTP_REFERER} == !~ m|^http://dumbdomain.com/| ) #then redirect to anotherpage.com { print "Location: http://www.anotherpage.com\n\n"; }