Forum Moderators: open
#!/usr/bin/perl
$calling_page = $ENV{'HTTP_REFERER'};
if($calling_page =~ /(.*)\#.*/) {
$calling_page = $1;}
# ignore any file that is not _e.shtml or _f.shtml and do nothing!
# is this an _e.shtml file?
if($calling_page =~ /_e\.shtml/) {
# replace the suffix
$calling_page =~ s{/e/(.+)_e\.shtml}{/f/$1_f.shtml};
print "Location: $calling_page\n\n";
# then is this an _f.shtml file?
}
elsif($calling_page =~ /_f\.shtml/) {
# replace the suffix
$calling_page =~ s{/f/(.+)_f\.shtml}{/e/$1_e.shtml};
print "Location: $calling_page\n\n";}