or download this
$page=$ENV{'REQUEST_URI'};
if ($page =~ /a\.html/) { $p="a.shtml"; }
elsif ($page =~ /b\.html/) { $p="b.shtml"; }
...
else { print header( -Refresh => "5; URL=http://foobar.com");
if ($p) { print header; printnewsite(2, $p); } else
{ printnewsite(1); }