2001-02-05 22:25:46 UTC
I haven't yet had time to fix up all the bugs in that first prototype and release a new package, but if you tried the 0.01 release and couldn't figure out why it didn't work, one reason might have been the bad redirect.cgi.
Try this instead:
#!/usr/bin/perl
$parkedpage = "index.shtml";
BEGIN {
do "/<path_to_your>/redirect.conf";
}
$server = lc($ENV{'HTTP_HOST'});
$server =~ s/^www.//; # strip the
http://www. so we can write
# only the fqdn to the conf file,
# will make it smaller...
@domains = keys(%redirects);
foreach $domain(@domains) {
if ($domain eq $server) {
print "Location: $redirects{$domain}\n\n";
$match="yes";
last;
exit
}
}
unless ($match) {
print "Location:
http://$server/$parkedpage\n\n";
exit
}
exit;