You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michelle Konzack <li...@freenet.de> on 2004/12/31 23:19:08 UTC

[users@httpd] Re: redirect all requests to /dev/null

Am 2004-12-31 11:23:05, schrieb Matthew Peltzer:
> Hi.  I'm using Apache/1.3.33 (Darwin), installed via fink.
> 
> I had heard somewhere that online adverts could be blocked by use of
> /etc/hosts, so I added a few lines to my /etc/hosts file:
> 
> 127.0.0.1 ad.doubleclick.net
> 127.0.0.1 ads.osdn.com
> 
> Since apache is running on my machine, I now get either HTTP/404 error
> messages, or root directory listings (my DocumentRoot lacks a default
> page by design).  This is better than ads, but I know I can do even
> better.

What are you trying to do ?

> My idea is to route any requests originally to the hosts in /etc/hosts
> to a special file, such as /dev/null or perhaps a 1x1 black image. 
> I've tried a number of things with <VirtualHost .../> and
> RedirectMatch and DirectroyMatch, but nothing works as desired, I
> either continue to get HTTP/404s or I can't access my local sites.

Blocking the Adds of other Servers has nothing to do with
your own Server, except, the addserver is your own... :-)

> Any ideas or pointers to similar setups?

I do not understand what you are trying to do.

If you like to block ADDs to be shown in your Mozilla/Firefox
Webbrowser go to <http://extensionroom.moz-dev.org/> and look
for "adblock" (use wirldcards and works perfectly...)

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/ 
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/3/88452356    67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Re: [users@httpd] Re: redirect all requests to /dev/null

Posted by Matthew Peltzer <go...@gmail.com>.
On Fri, 31 Dec 2004 17:53:41 -0500, Sean T Allen <se...@usaherbals.com> wrote:
>  Perhaps he is proxying through his server?

Uh... perhaps, its more like i'm setting some partial DNS rules for
myself.  Allow me to be more explicit:  most of the ads I see (such as
on slashdot.org) are images that are hosted on an external site (such
as 'http://ads.osdn.com').  The entry in /etc/hosts then would be
"127.0.0.1 ads.osdn.com", which makes my browser look at my loopback
address for the specified file.

In some cases there actually is a file that is being requested, but in
others the URL is simply of the fom
'http://$hostname/?$list-of-params".  In both cases I want to
configure apache to resolve to /dev/null, or some other file of my
choosing.

Maybe apache isn't the right tool for the job, but it seems rather
appropriate in this case.  Doing browser-level blocking isn't
acceptable as I don't ever want to fetch these advers, regardless of
the user agent I may be using (i.e., consider curl or wget).


-- Matthew Peltzer
-- goochrules@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: redirect all requests to /dev/null

Posted by Sean T Allen <se...@usaherbals.com>.
Perhaps he is proxying through his server?

Michelle Konzack wrote:

>Am 2004-12-31 11:23:05, schrieb Matthew Peltzer:
>  
>
>>Hi.  I'm using Apache/1.3.33 (Darwin), installed via fink.
>>
>>I had heard somewhere that online adverts could be blocked by use of
>>/etc/hosts, so I added a few lines to my /etc/hosts file:
>>
>>127.0.0.1 ad.doubleclick.net
>>127.0.0.1 ads.osdn.com
>>
>>Since apache is running on my machine, I now get either HTTP/404 error
>>messages, or root directory listings (my DocumentRoot lacks a default
>>page by design).  This is better than ads, but I know I can do even
>>better.
>>    
>>
>
>What are you trying to do ?
>
>  
>
>>My idea is to route any requests originally to the hosts in /etc/hosts
>>to a special file, such as /dev/null or perhaps a 1x1 black image. 
>>I've tried a number of things with <VirtualHost .../> and
>>RedirectMatch and DirectroyMatch, but nothing works as desired, I
>>either continue to get HTTP/404s or I can't access my local sites.
>>    
>>
>
>Blocking the Adds of other Servers has nothing to do with
>your own Server, except, the addserver is your own... :-)
>
>  
>
>>Any ideas or pointers to similar setups?
>>    
>>
>
>I do not understand what you are trying to do.
>
>If you like to block ADDs to be shown in your Mozilla/Firefox
>Webbrowser go to <http://extensionroom.moz-dev.org/> and look
>for "adblock" (use wirldcards and works perfectly...)
>
>Greetings
>Michelle
>
>  
>


Re: [users@httpd] Re: redirect all requests to /dev/null

Posted by Matthew Peltzer <go...@gmail.com>.
On Sat, 1 Jan 2005 01:00:10 +0000 (GMT), Nick Kew <ni...@webthing.com> wrote:
> > > I had heard somewhere that online adverts could be blocked by use of
> > > /etc/hosts, so I added a few lines to my /etc/hosts file:
> > >
> > > 127.0.0.1 ad.doubleclick.net
> > > 127.0.0.1 ads.osdn.com
> 
> Use an IP that resolves to nowhere instead of that.  Or something
> bogus like 255.255.255.254.

That works great, but doesn't answer the question: how can I resolve
request that may or may not have any path specifier or file specifier
or url parameters to a single file (such as /dev/null)?

-- Matthew Peltzer
-- goochrules@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: redirect all requests to /dev/null

Posted by Nick Kew <ni...@webthing.com>.
> > I had heard somewhere that online adverts could be blocked by use of
> > /etc/hosts, so I added a few lines to my /etc/hosts file:
> >
> > 127.0.0.1 ad.doubleclick.net
> > 127.0.0.1 ads.osdn.com

Use an IP that resolves to nowhere instead of that.  Or something
bogus like 255.255.255.254.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org