127.0.0.1     xiaxue.blogspot.com

I was reading Publiceducator’s post on his blog and out of fun I commented that if we don’t like to read someone, we can always put that person’s blog address into our host file in c:windowssystem32driversetc.

For e.g., if you don’t like this particular blog, you can just put the following entry into the host file:

127.0.0.1     xiaxue.blogspot.com

This will work as long as your browser does not use a proxy server for access. However, you can also use a .pac file as a configuration script. All you need to do is open notepad, and fill in the following text and then save the file with a .pac extension in c:. (For e.g. fxxkupblogs.pac)

function FindProxyForURL(url, host)
{if (shExpMatch (host, “xiaxue.blogspot.com”)) return “127.0.0.1:8080;”;
return “DIRECT;”
}

After which, you should have the browser use this file to determine what proxy to use. For e.g. in Firefox, you choose Automatic proxy configuration File URL and enter this: file:///c:/fxxkupblogs.pac.

And you are done. Even if by accident you clicked on a link pointing to that abominable site, you will NEVER end up there.

PS: Let me know if the code doesn’t work. I had a whole lot of other things in mine, and I cut and pasted out this part as an example so I might have carelessly removed some other parts I shouldn’t have removed.

3 comments

Leave a Reply

Your email address will not be published. Required fields are marked *