[SLUG] Ad blocking with hosts file and apache

From: Paul M Foster (paulf@quillandmouse.com)
Date: Thu Mar 18 2010 - 15:22:52 EST


To avoid a lot of ads, I use a trick where I identify the servers which
are typically serving up ads, and remap them to 127.0.0.1 in my
/etc/hosts file. This means I don't have to look at the ads. But it also
means that I get a lot of apache barf on the page where the ad would be.
The browser is trying to find whatever file is being asked for on my
localhost, and apache can't find it (naturally). So there is 404 error
text and the like.

In order to avoid all this, is it possible to tell apache to server up a
one-pixel graphic or somesuch whenever it's asked for a file I don't
have? I don't actually serve any content from my localhost, even though
apache is running in the background.

Paul

-- 
Paul M. Foster
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:02:40 EDT