All pastes #931335 Raw Edit

Something

public text v1 · immutable
·published 2008-03-07 02:43 UTC
rendered paste body
#!/usr/bin/perl

my $content = '';

eval {

my %redirs = ( 'www.empowercoaching.com.au' => '/up/up.php'
, 'www.closethegap.net.au' => '/up/up.php'
, 'www.mkpsyd.org' => '/mkpsyd/' );

my $host = $ENV{HTTP_HOST};

my $redir = $redirs{$host};

if ($redir)
{
my $url = $redirs{$host};
$content = <<DATA;
<html>
<head>
<meta http-equiv='refresh' content='0;url=$url' />
</head>
<body>
</body>
</html>
DATA
}
else
{
$content = 'You tried to access ' . $host . '.';
}


};

$content = $@ if ($@);

print "Content-type: text/html\r\n";
print "Content-length: ", length($content), "\r\n";
print "\r\n";

print $content;