06 July 2007

RegEx Ad blocking with Squid Proxy

ACL's provided in squid are not only good to control access by users, but also useful to keep away unwanted content like ads or xxx sites by using Regular Expressions. In addition to the common 'allow all local user' something like:

acl adserver_regex dstdom_regex -i ^ad\. ^ads\.
http_access deny adserver_regex

is nice to have, just to give an example. The 'Access Denied' Error Page that squid will deliver in case of a blocked add might be replaced to something more eyecandy / non-technical output for the common user.

www.squid-cache.org
pgl.yoyo.org/adservers/