Redirector failing on 302
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Squid > Redirector failing on 302




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Redirector failing on 302  
hinchley@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:05 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register