Custom block page works - local images dont load?

Please follow the below template, it will help us to help you!

Expected Behaviour:

Custom block page works. If i reference external img src files they load just fine, but when referencing files located in the same directory as the customblockpage.php they dont load.

img src isnt the most complicated thing so i’m mega confused as to why its not working.

I’ve taken previously done work and copied it. got it working, but realized local files were not working when displaying the block page. Here is my “customblockpage.pgp” file.

<body background="">
      <IMG SRC="firsttry.gif">
      <FONT Size=+2>
         This page has been blocked by Mean ol' Mr. Dustin!  Its either a crap site, malicious, or just doesnt exist.<BR>

      Notice: Some pages have been blocked due to content or bandwidth restrictions.
      If you believe that this page has been blocked in error,<BR>please contact Mean ol' Mr. Dustin.

The background image displays … its referencing an external image … the local “firsttry.gif” doesnt work.
makes no sense to me. I know this probably isnt technically a pihole issue, but figured i’d beg for mercy and see if I could get this working by begging for help. sorry!

Actual Behaviour:

local files dont render on the block page

Debug Token:

Sorry … the HTML tags are messing up the rendering …

basically this works

#body background=“”#

but this doesnt

The file referenced above “firsttry” is in the same directory as the .php file so i’m assuming it should render

#IMG SRC=“firsttry.gif”#

replacing the <> with #

What exactly do you mean when you say it doesn’t work? Is there an empty placeholder for the image? What does the Developers Tools show in the browser on a client, any errors?

And as an aside, please don’t link to our images on our content delivery network, download the file and store it locally.

Yes. When i say it doesn’t work i mean you’ll see the little default “image cant load” type pic. I haven’t checked developers tools … will try that now.

I’m not intentionally doing this for the long term … just as a method of troubleshooting. Dont hate me please lol!

In developers tools when I mouse over the it looks like its trying to load it from “” instead of locally.

thats the site i’m testing the blockpage with

See if either <IMG SRC="/firsttry.gif"> or <IMG SRC="./firsttry.gif"> work. Also, check the /var/log/lighttpd/error.log or access.log for any helpful entries. Not knowing how you have structured your files or your naming scheme this is what I can offer as hints.

Tried both of those variants and it hasnt resolved. cat’d both logs and didnt see anything relevant although to be honest i’m not sure what i’m looking for …

Here is the current directly structure:
@pihole:/var/www/html/pihole $ ls -lrt
total 3692
-rw-r–r-- 1 root root 3472589 Mar 6 2017 pihole-llc.png
-rw-r–r-- 1 root root 30998 Sep 5 2017 Vortex-R.png
-rwxr-xr-x 1 root root 14359 Jul 4 22:43 index.php
-rwxr-xr-x 1 root root 12594 Jul 4 22:43 blockingpage.css
-rwxr-xr-x 1 root root 231960 Jul 12 20:47 firsttry.gif
-rwxr-xr-x 1 root root 610 Jul 12 22:43 CustomBlockPage.php
-rwxr-xr-x 1 root root 611 Jul 12 22:46 CustomBlockPage.html

I’ve tried both *.php and *.html when it comes to the “customblockpage” … updating the lighttpd.conf to reflect the correct variant appropriately.

based on what i’m seeing its like its trying to use the as the source as the picture points back to the gif i’m trying to use as

so it seems likes its using the page that is being blocked “” as the source for the gif that i’m trying to use even though based on the img src tag it should be looking locally.


Thanks for your help thus far!

Only other thing I can think to try off the top of my head is to explicitly say that it’s a file and not a URL. <IMG SRC="file:///firsttry.gif">

You only have html in that custom file so don’t name it .php, you don’t want that to go through the processor.

Thanks for your help, man! Tried that and it still doesnt work. Obviously this isnt a pihole problem like I stated earlier. I’ll keep chipping away at this until I figure it out. Seems so damn strange that it wont read the local imgs available in the same directory as the html file.

I shouldnt have to reload the lighttpd service or anything to read the differences in this file should I? When i make other changes such as text it reads it just fine on the browser refresh. Its just the damn images … so strange. HTML isnt this hard, lol.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.