Re: [SLUG] Ad blocking with hosts file and apache

From: Eben King (eben01@verizon.net)
Date: Thu Mar 18 2010 - 16:54:46 EST


On Thu, 18 Mar 2010, Paul M Foster wrote:

> 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.

What happens if you redirect them to 127.0.0.2 instead? Or some unused
address in the 192.168.*.* or 10.*.*.* ranges?

-- 
-eben   QebWenE01R@vTerYizUonI.nOetP   royalty.mine.nu:81

My parents went to a planet where the inhabitants have no bilateral symmetry, and all I got was this lousy F-shirt. ----------------------------------------------------------------------- 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:50 EDT