[Home]ToothyWikiInternals/EgressCounter

ec2-35-173-47-43.compute-1.amazonaws.com | ToothyWiki | ToothyWikiInternals | RecentChanges | Login | Webcomic


Simple redirection script that filters some characters to stop javascript and HTML abuse and means that people leaving the site via it show up in the logs.


#! /usr/bin/perl -w
use English;
use strict;

my $CRLF = "\015\012";

my $url = $ENV{'QUERY_STRING'};
defined $url or $url = "localhost";

$url =~ s/\:/%3A/g;
$url =~ s/\(/%28/g;
$url =~ s/\)/%29/g;
$url =~ s/\ /%20/g;
$url =~ s/\</%3C/g;

$url = 'http://' . $url;
print "Content-Type: text/html".$CRLF;
print "Location: ".$url.$CRLF.$CRLF;
print "Redirect: <A HREF=\"$url\">$url</A>."



ec2-35-173-47-43.compute-1.amazonaws.com | ToothyWiki | ToothyWikiInternals | RecentChanges | Login | Webcomic
Edit this page | View other revisions | Recently used referrers
Last edited February 4, 2003 7:30 pm (viewing revision 1, which is the newest) (diff)
Search: