Simple Squid redirector perl script

Since jesred won't work on OpenBSD>4.0 i managed to solve my redirect problem with a simple Perl script

/usr/local/libexec/squid-redirector.pl
#!/usr/bin/perl
$|=1;
while (<>) {
s@http://ec.europa.eu/taxation_customs/vies/cgi-bin/viesquer@http://ec.europa.eu/taxation_customs/vies/vieshome.do@;
print;
}

check perl binary location

which perl

chmod 750 /usr/local/libexec/squid-redirector.pl
chown root._squid /usr/local/libexec/squid-redirector.pl

adapt squid.conf

url_rewrite_program /usr/local/libexec/squid-redirector.pl

Comments

Popular Posts