Author Topic: Blocking web ads  (Read 1604 times)

Offline videobruce

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Blocking web ads
« on: October 30, 2003, 07:36:49 AM »
I did a search for this and nothing came up (in case someone asks).
I have the article titled "Blocking Web Ads" and since I have never done this before, is all I have to do is do a copy/paste to the 'hosts' file the addresses in that article WITHOUT doing ANYTHING else??
In other words all the 127.0.0.1 entries are copied WITHOUT adding ANYTHING else to the file??

The text in the orginal file gives me the impression that you have to type in additional info on each line as follows:

Quote
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

Anyone please explain before I do this.
« Last Edit: December 04, 2004, 01:52:33 PM by videobruce »

Rick.C

  • Guest
Blocking web ads
« Reply #1 on: December 04, 2004, 08:29:45 AM »
Hi,

Here is a slick way to improve upon the idea of adding the advertiser list to your \etc\hosts file:

Set up the \etc\hosts file as described, using the latest list (available from http://pgl.yoyo.org/adservers/) and pointing to 127.0.0.1.

Download and install Apache HTTP Server from http://www.apache.org/. (Get the Windows version if you're running Windows, of course.)

Customize the httpd.conf by finding the following #Comments and adding the two ErrorDocument lines after them. This was around line 875 in my httpd.conf file.

#
# Customizable error response (Apache style)
#  these come in three flavors
#
#    1) plain text
#ErrorDocument 500 "The server made a boo boo.
#  n.b.  the single leading (") marks it as text, it does not get output
#
#    2) local redirects
#  to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl

ErrorDocument 404 /index.html
ErrorDocument 402 /index.html


This instructs Apache to use your index.html file to respond to requests for unknown sites/pages. This is important because ~all~ of the requests it gets will be for for unknown sites/pages.

Next, create an Apache\htdocs\index.html file containing these four lines:

<script>
window.opener=self;
window.close()
</script>

Finally, create a shortcut to Apache.exe in your "C:\Documents and Settings\All Users\Start Menu\Programs\Startup" folder so that it will start automatically.

Now the redirects in your host file point to your own Apache Web Server which not only blocks the ads, but closes the pop-up windows automatically! Ads that are not pop-ups are merely blocked - the window containing them is not closed.

What you've done is set up a "dummy" web server that only knows how to do one thing - close down the browser window that calls it. Of course, ads that originate directly from the site you are browsing will not be blocked. If you are browsing dell.com, you will still see the pop-ups for the latest "Dell Deals" because that comes directly from dell.com, not from an ad server.

One last note - you won't be able to use this "dummy" web server to serve real pages.

One final last note - in addition to the ad servers, you can add other domain names to your \etc\hosts file. If you don't want some piece of software "phoning home" and bugging you about installing their lastest update, just *plonk* their name into your \etc\hosts file and you'll never hear from them again! Sweeeeet!

Rick.C

Offline guestolo

  • Site Donator
  • Administrator
  • Hero Member
  • *****
  • Posts: 16034
  • Karma: +1/-0
    • View Profile
    • http://
Blocking web ads
« Reply #2 on: December 04, 2004, 01:47:35 PM »
I'm with you guys, get a good Custom Host file
Rick linked to one
Another one that was created by WinHelp
is at this link, lot's of info too
http://www.mvps.org/winhelp2002/hosts.htm

Another great program, help too block bad activeX controls and cookies
SpywareBlaster by JavaCool---will block bad ActiveX and malevolent cookies
Install---Check for Updates---Enable all protection
http://www.javacoolsoftware.com/spywareblaster.html
Doesn't run in the background, just run it once and Check for updates every couple of weeks
Enable all protection after every update

Do you want to post your own logs from FRST?

Follow the instructions posted http://www.thetechguide.com/forum/index.php/topic/22942-please-read-how-to-post-logs-from-frst/\'>Click Here


Offline videobruce

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Blocking web ads
« Reply #3 on: December 04, 2004, 01:51:59 PM »
Thanks for the info.

What I'm concerned about are pop-ups that are NOT ads, but part of the page your are working with.
Example; 'enlarge image' links that popup a larger image, forums that use a popup window to login or answer a thread etc.

Also, the images in Amandtech's reviews I believe were blocked by these hosts files:

http://www.######.com/mb/showdoc.aspx?i=2080

Just to use this for example.  I don't have the hosts file installed in my box now, so it does display all the images.  It was really noticeable when you clicked on the 'print this article' button.
« Last Edit: December 06, 2004, 10:29:56 AM by videobruce »

pro

  • Guest
Blocking web ads
« Reply #4 on: February 14, 2005, 07:21:48 PM »
Dude, get Mozilla and all your problems will go away.  I use Mozilla and I never get popups and everything from the site you are at works just as it should.