Customize Block Page

Hey all!
first time playing with the pi-hole and i really dont have much scripting skills.
Long story short i wanted to make sure that when something is blocked that my wife when working home will know its because of my "toys".. this way i can quickly fix it.

i followed the above guide however it didnt work well so i looked up another guide which suggested using php instead of htm..

Here are the refined instructions for my particular block page setup…

How to set up a custom block page in Pi-Hole:

  1. On the pi-hole go to the /var/www/html/pihole folder
  2. type the following:
wget https://pi-hole.net/wp-content/uploads/2016/12/Vortex-R.png
wget https://piholenet.b-cdn.net/wp-content/uploads/2017/03/pihole-llc.png
  1. Create an PHP file for your custom block page with the name “CustomBlockPage.php” and paste the HTML code in the file:
    (NOTE: Do not use LeafPad to make the file because it does not correctly format text for our purposes.)

sudo nano /var/www/html/pihole/CustomBlockPage.php

<HTML>
<TITLE>BLOCKED</TITLE>
<BODY BGCOLOR=000000 BACKGROUND="pihole/pihole-llc.png" TEXT=FFFFFF>
   <CENTER>
      <BR>
      <IMG SRC="pihole/Vortex-R.png" WIDTH=100><BR>
      <FONT Size=+2>
         <BR>
         This Page has Been Blocked<BR>
         *OR* Does not exist<BR>
      </FONT>
      <BR>
      Notice: Some pages have been blocked due to content or bandwidth restrictions.
      <BR>
      <BR>
      If you believe that this page has been blocked in error,<BR>please contact the front desk.
   </CENTER>
</BODY>
</HTML>

Save and close.

  1. Set your file’s permissions:

sudo chmod +x /var/www/html/pihole/CustomBlockPage.php

  1. Open the “lighttpd.conf” file to change the error handler for 404 file not found errors so that the custom block page opens instead of the default:

sudo nano /etc/lighttpd/lighttpd.conf

  1. Comment out the line “server.error-handler-404=“pihole/index.php”” with “#”, then add a new line with the custom block page file:
#server.error-handler-404="pihole/index.php"
server.error-handler-404="pihole/CustomBlockPage.php"

Save and exit.

  1. Restart the lighttpd service:

sudo service lighttpd restart

  1. Change the blocking mode to “IP” in the “pihole-FTL.conf” file by adding a block mode line:
    *note: I changed mine ti BLOCKINGMODE=IP its up to you
    Blocking modes options: https://docs.pi-hole.net/ftldns/blockingmode0/

sudo nano /etc/pihole/pihole-FTL.conf

  1. add this line:

BLOCKINGMODE=IP

Save and exit.

  1. Restart the pihole-FTL service:

sudo service pihole-FTL restart

Congratulations, your block page is now ready.