Search squid archive

Re: Squid redirection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



jayesh chavan wrote:
Hi,
        I have written script which redirects my squid to local
apache.It works fine for FOLLOWING SCRIPT

    #!c:/perl/bin/perl.exe
    $|=1;
    while (<>) {
    s@http://www.az.com@http://117.195.4.252@;
    print;
     }

But whenever I use this script
#!c:/perl/bin/perl.exe
$|=1;
while (<>) {
    s@http://www.az.com@http://117.195.4.252//index.html@;
    print;
   }

It doesnt work.I observed that this is happening due to redirect
program which is appending / at the end of rewritten url.It gives
error as:
                                               The requested URL
/index.html/ was not found on this server.
How to avoid that?

 * Squid passes the URL whole to the script
 * The redirect script does exactly what you program into it.
 * Squid uses exactly what the script outputs.


Your web browser is requesting:

   http://www.az.com/

http://117.195.4.252/ is a valid URL at the receiving server which is why the first one works.


If you were to request

  http://www.az.com/some.html

methinks that script will re-write it as:

  http://117.195.4.252//index.html/some.html

Amos
--
Please be using
  Current Stable Squid 2.7.STABLE8 or 3.0.STABLE25
  Current Beta Squid 3.1.0.18

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux