Re: [squid-users] Redirector help

From: Denis Vlasenko <vda@dont-contact.us>
Date: Tue, 23 Mar 2004 09:18:06 +0200

On Monday 22 March 2004 21:04, Bruno Lustosa wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi.
>
> I recently implemented a redirector on squid for filtering bandwidth
> wasting content for some clients. Basically, clients connect to squid,
> and using an external redirector, it redirects certain urls to a 1x1
> black gif file on an apache server.

I changed Squid 'denied' error pages (added random-colored background).
Now all ads IFRAMEs are replaced with rainbow colored boxes.
Attached below.

But it does not work for <img> images, they show ip as empty boxes instead.

Can you share your solution with me?

squid.conf:
...
acl ads_regex url_regex -i [./]banners*[./?]
acl ads_regex url_regex -i [./]bannerserver[./?]
acl ads_regex url_regex -i [./]bannerbank[./?]
acl ads_regex url_regex -i [./]bannerfarm[./?]
acl ads_regex url_regex -i \.linkexchange\.ru:*[0123456789]*/
acl ads_regex url_regex -i [./]adv[./?]
acl ads_regex url_regex -i /count.*\?
acl ads_regex url_regex -i /ping.*\?
acl ads_regex url_regex -i [./]adserver
acl ads_regex url_regex -i /phpAdsNew.*/ad.*\.php\?
acl ads_regex url_regex -i /adsystem.*/ad.*\.php\?
...etc etc etc...
...
http_access deny ads_regex
...

errors/English/ERR_ACCESS_DENIED:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The requested URL could not be retrieved</TITLE>
<SCRIPT>
function paint() {
    var r=(50+50*Math.random());
    var g=(50+50*Math.random());
    var b=(50+50*Math.random());
    var s='rgb('+r+'%,'+g+'%,'+b+'%)'
    document.body.style.cssText='background-color:'+s+';';
}
</SCRIPT>
</HEAD><BODY onload='paint();'>
<P>Access to URL %U is denied.
<P>Please contact your service provider if you feel this is incorrect.

--
vda
Received on Tue Mar 23 2004 - 00:30:16 MST

This archive was generated by hypermail pre-2.1.9 : Thu Apr 01 2004 - 12:00:02 MST