Can't access public web directory

I can't access any folder located in public web directory /var/www/html/FOLDER/FOLDER/FILES. I both tried using the IPv4 address and hostname. Same result. Please check attachment.

That looks like the page HAS loaded, but it's missing its assets (CSS/JS etc).

If you open up the dev console, do you see any 404 errors?

what is dev console?

http://<domain>/public/ISO/ is a 404 error.

no 404 error.

Yes, 404 error.

How can I fix it?

Google for "how to fix 404 errors"?

but I can access http://ipaddress/admin and also access (download) http://ipaddress/public/ISO/boot.iso. just directory listing not working.

Then your webserver isn't configured to display directory listings. Fix that.

i'm using default pihole configuration

Our configuration is not designed for hosting other services or files.

Add below line to the file /etc/lighttpd/external.conf :

$HTTP["url"] =~ "^/public($|/)" { server.dir-listing = "enable" }

And reload to apply:

sudo service lighttpd reload

1 Like

Thank you so much, it worked! I'm glad you helped me.

1 Like

Explanation is that you were trying to access a folder that didnt contain an expected index.php or index.html file resulting in a 404 error as posted by @DanSchaper previously.
Pi-hole is configured to handle 404's in its own way:

pi@ph5:~ $ cat /etc/lighttpd/lighttpd.conf
[..]
server.document-root        = "/var/www/html"
server.error-handler-404    = "/pihole/index.php"
[..]

Making the folder file listing enabled, mitigates the 404 error.

1 Like

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