Generate a proper 404 page for blocked sites via /etc/hosts instead of redirect to localhost

Posted by Mixhael on Ask Ubuntu See other posts from Ask Ubuntu or by Mixhael
Published on 2012-09-17T00:40:45Z Indexed on 2012/09/17 3:52 UTC
Read the original article Hit count: 588

Filed under:
|
|
|

I have blocked some websites by editing /etc/hosts and adding several newline-entries in the following manner:

0.0.0.0 www.domain.com

And it works. The only thing is: when a website is visited which is blocked, the browser is redirected to my http://localhost, resulting in a directory listing or website-presentation that is running within my localhost root-environment.

It's not a very big problem, but I prefer a standard error that mentions the website cannot be visited (for instance by a 404 page). Is this possible?

© Ask Ubuntu or respective owner

Related posts about system

Related posts about websites