How to make a custom blocked site

Edit: Since the recent update of pihole it now has a blocked site.

What you need to know:

If you try to open a site which is blocked by Pi-hole you will see the 404 site because this prevents from loading until the request times out.

The 404 site currently looks like this:

<html>
<head>
<script>window.close();</script>
</head>
<body>
</body>
</html>

If you haven’t disabled JS the window will close.

How to:

You can simply change the index.html which is located at /var/www/html/pihole/ (if you didn’t changed it).

So you could just change it to:

<html>
<head>
</head>
<body>
<p>This site is blocked.<p>
</body>
</html>

If you want you can now build your custom site but if you don’t have the time/knowledge you can use the Pi-hole Block Page by WaLLy3K.

If you want to use PHP you need to change in the (/etc/lighttpd/) lighttpd.conf the server.error-handler-404 to “pihole/index.php”.

Important:

If you use PHP you have to change the server.error-handler-404 again everytime after you updated Pi-hole because the update overrides it.

Didn’t knew that you actually planned this. Good work!