Squid - Redirector failing on 302

This is Interesting: Free IT Magazines  
Home > Archive > Squid > August 2005 > Redirector failing on 302





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Redirector failing on 302
hinchley@gmail.com

2005-08-11, 7:47 am

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.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com