Lighttpd how to configure for folder acces

Did you create any custom configs, which could maybe be responsible for this?
If you want you can share your whole config and I can have a look.

So a rule like the following could create a 404 error for every sub-directory.

$HTTP["url"] =~ "^($|/)" {
       url.access-deny = ("")

Command to show the whole lighttpd config:

cat /etc/lighttpd/lighttpd.conf && cat /etc/lighttpd/conf-enabled/*