[Home]ToothyWikiInternals/EgressCounter

ec2-3-142-200-226.us-east-2.compute.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-3-142-200-226.us-east-2.compute.amazonaws.com | ToothyWiki | ToothyWikiInternals | RecentChanges | Login | Webcomic
This page is read-only | View other revisions | Recently used referrers
Last edited February 4, 2003 7:30 pm (viewing revision 1, which is the newest) (diff)
Search: