|
If you can use perl then hopefully this will do what you want:
-------------------------------------------------------------------------
#!/usr/bin/perl -wT
use strict;
my $url = $ENV{'HTTP_REFERER'};
my $main_page = "index.cgi";
open (DOMAINS_DB, "< domains.db");
my @JUMP = <DOMAINS_DB>;
# Loop through database file
foreach my $row (@JUMP) {
chomp($row);
my ($domain, $page) = split(/\|/, $row);
if ($domain eq $url) {
# If found jump to new landing page
print "Location: $page\n\n";
}
}
close (DOMAINS_DB);
exit(0);
-------------------------------------------------------------------------
Example of domains.db file
www.domain1.co.uk|loans.html
www.domain2.com|people.cgi
www.domain3.co.uk|money.php
etc
etc
|