08-11-05 12:47 PM
I have a redirector configured in squid.conf:
redirect_program c:/perl/bin/perl.exe c:/squid/libexec/redirector.pl
The redirector.pl is very simple:
$|=1;
while (<> ) {
@X = split;
$url = $X[0];
$url =~ s/www.blah.net/www.blah.com/;
print "302:$url\n";
}
It translates www.blah.net to www.blah.com and issues a HTTP 302.
The redirector executes as expected, with the log file showing:
clientRedirectDone: 'www.blah.net:443' result=302:www.blah.com:443
However, squid tries to look up 302 as a server, rather than
interpreting it as a redirect:
ipcache_nbgethostbyname: Name '302'.
ipcacheParse: Lookup failed 'Server Failure: The name server was unable
to process this query.' for '302'
Why?
I have tried using alternate scripts, such as:
$|=1;
while (<> ) {
s@https://www.blah.net@302:https://www.blah.com@;
print;
}
But this script also fails, because the "https://" isn't passed to the
redirector, and hence the string replacement fails as a match cannot be
found. If i change the script to remove the "https://" the outcome is
the same as that described for the first script.
Very confused. Any help would be greatly appreciated.
Thanks, Hinch.
[ Post a follow-up to this message ]
|