Point an URL to a local html-page via hosts file

1

I want to surprise myself with a picture of an evil looking monkey every time I access Facebook by habit or rather by addiction.

Therefore I added the following lines to /private/etc/hosts:

# Block Facebook
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 static.ak.fbcdn.net
127.0.0.1 www.static.ak.fbcdn.net
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.connect.facebook.com
127.0.0.1 www.static.ak.connect.facebook.com

The actual question is: Does someone know a good way of letting it point to a local file e.g. in the OS X native „Website“-Folder. I don't want to run an apache all the time. I'd truly appreciate your help.

wrndl

Posted 2011-09-20T18:24:05.660

Reputation: 11

You could upload a picture to Photobucket and have it forward to those... I think that would be a lot easier... For instance have it point to a page like this

– David – 2011-09-20T18:27:21.223

I forgot that you can't direct it to a specific URL, only IP addresses. @akub.gieryluk's answer is the only way I know of other than having some type of web server application installed on your server... – David – 2011-09-20T18:38:28.850

Answers

2

LeechBlock is definitely the thing for you, if you're using Firefox. You can redirect any set of URLs (e.g. facebook.com/*) to a given URL.

Regarding hosts file, all you can is to do a redirect to a given IP (unless you use some extra application that will add more functions).

jakub.g

Posted 2011-09-20T18:24:05.660

Reputation: 4 332