Hi everyone, I am running Squid 2.5STABLE5 and trying to block a few of the more prominent web advertisements that chew bandwidth. The way I have tried to set this up is with i) two acls to match advert objects - one a dstdomain and one a url_regex ii) a short perl redirector which redirects requests for these ad objects to a 1x1 transparent gif hosted on a local server.
This seems to be working to a point. The problem I am experiencing is that many (but not all) pages which have ads that get redirected load ok but Internet Explorer browsers never think the page has completed loading. It sits there with the IE icon whirling around and 'Opening page http://requested.address.com' in the status bar. This doesn't prevent users from viewing their pages, but it is annoying. Prior to using the redirector I just denied and TCP_RESET the requests which matched the advert acls using deny_info - this did not cause the continuous loading behaviour that we are experiecing with the redirector. Should I be appending the newline character at the end of the redirected URL (see code below)? Is there anything else wrong with the redirector code? How do I prevent this continuously loading page behaviour? Initially I was trying to redirect to an image which I hosted within the squid-internet-static area. This was causing cache.log to fill up with forwarding loop warnings. I realise that it is indeed forwarding back to itself but think that this should be allowed for internal-static objects. Is there a way to get rid of the warnings? In the meantime the GIF is now hosted on an internal webserver. ---- Appropriate lines of squid.conf ---- acl denied_advert_domains dstdomain -i "/usr/local/squid/etc/denied_advert_domains" acl denied_advert_urls url_regex -i "/usr/local/squid/etc/denied_advert_urls" redirect_program /usr/local/squid/bin/ad_redir.pl redirect_children 5 redirector_access allow denied_advert_domains redirector_access allow denied_advert_urls redirector_access deny all ---- End squid.conf lines ---- ---- Redirector program ad_redir.pl ---- #!/usr/bin/perl $|=1; while (<>) { print "http://host.domain.com/1x1transgif.gif\n" } ---- End of program ---- Thanks for any help that is provided. Regards, Ken.
