[squid-users] squid redirect not working

From: jayesh chavan <jayesh.jayiesh_at_gmail.com>
Date: Wed, 10 Mar 2010 10:30:53 +0530

Hi,
    I have written redirect program which is not working.The program
is as follow:
   #!c:/perl/bin/perl.exe
$|=1;
while (<>) {
@X = split;
$url = $X[0];
if ($url !~ /^http:\/\/www\.hostname\.com/) {
$_ = $url;
s/^http:\/\/(.*)\/(.*)/http:\/\/www.hostname.com\/\2/;
print "301:$_\n";
} else {
print "$url\n";
}
}

squid config contains:
url_rewrite_program c:/squid/libexec/redirect.pl
url_rewrite_children 15
url_rewrite_concurrency 0
url_rewrite_host_header on
redirector_bypass off

Regards,
  Jayesh
Received on Wed Mar 10 2010 - 05:01:03 MST

This archive was generated by hypermail 2.2.0 : Sat Mar 13 2010 - 12:00:03 MST