[squid-users] rewriting urls

From: Ioakim Spyros <sioakim@dont-contact.us>
Date: Mon, 11 Mar 2002 11:27:29 +0200

I have posted the following to the Squidguard list but got no answer
yet.
If anyone can help please let me know...
I have more info at the end of the mail:

Hello all,

I have the following in squidguard.conf:
rewrite hp {
 
s@ftp://ftp.hp.com/pub/ccd/@ftp://ftp.ace-hellas.gr/pub/hp/kayak/@r
}

I'm mirroring the ftp://ftp.hp.com/pub/ccd and I want all the people in
the company to use the local mirror instead of fetching the files from
hp for bandwidth reasons.

I applied this in my acl like that:
acl {
     grownups {
              rewrite hp
              pass all
              }

I go to:
http://www.support.vectra.hp.com/kayaksupport/level4/501kdf899en.exe.htm
l
and click on Download Now

Problem is that Internet Explorer pops up a window that says: Internet
Explorer cannot download kdf899en.exe from ftp.hp.com. Internet Explorer
was not able to open this Internet site. The requested site is either
unavailable or cannot be found. Please try again later.

Opera says (by clicking twice on Download Now):
Redirected to ftp://ftp.ace-hellas.gr/pub/hp/kayak/kdf899en.exe
Generated by Opera (c)
by clicking on the link you can fetch the file...

wget will display 302 Moved Temporarily and download the file from the
correct url.

Lynx says:
Alert!: Unable to access document.
and of course doesn't download it.

More info:
I checked out the FAQ and created the perl script as below:

#!/usr/local/bin/perl
$|=1;
        while (<>) {
                @X = split;
                $url = $X[0];
                if ($url =~ /^ftp:\/\/ftp\.hp\.com\/pub\/ccd/) {
                        $url =~
s/^ftp:\/\/ftp\.hp\.com\/pub\/ccd/ftp:\/\/ftp.ac
e-hellas.gr\/pub\/hp\/kayak/;
                        print "302:$url\n";
                } else {
                        print "$url\n";
                }
        }

I configured this in squid.conf and it works again ok with wget and
opera but not with IE or lynx.
Same results like Squidguard.

What gives?
Is there something screwed up with IE and lynx or does it require
something more than just "302:" ?

Thanks a lot for any info you can provide.

Spyros
Received on Mon Mar 11 2002 - 02:27:38 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:06:49 MST