Observe the following directory structure: index.html test/ bla.txt And the following configuration: DirectoryIndex disabled DirectorySlash Off FallbackResource /index.html This all works fine (index.html is shown) if the document can't be mapped to the file system; however, when `/test/` is requested, it will show a 404 page. This is also disussed in the following question: http://serverfault.com/questions/568952/use-fallbackresource-even-if-directory-exists I've written a patch for this: static int dir_fixups(request_rec *r) { if (r->finfo.filetype == APR_DIR) { /* serve up a directory */ - return fixup_dir(r); + if (fixup_dir(r) == DECLINED) { + return fixup_dflt(r); + } } else if ((r->finfo.filetype == APR_NOFILE) && (r->handler == NULL)) { /* No handler and nothing in the filesystem - use fallback */ return fixup_dflt(r); } return DECLINED; }
I've added a PR for this: https://github.com/apache/httpd/pull/5
Created attachment 32669 [details] If a directory exists but no indexes can be resolved, the fallback resource should be attempted first before giving up.
(In reply to Jack from comment #2) > Created attachment 32669 [details] > If a directory exists but no indexes can be resolved, the fallback resource > should be attempted first before giving up. committed with tweaks and a small paranoia addition in http://svn.apache.org/viewvc?view=revision&revision=1675103. Proposed for backport.
This had to be reverted because it broke mod_autoindex and potentially something more complicated
(In reply to Eric Covener from comment #4) > This had to be reverted because it broke mod_autoindex and potentially > something more complicated Is there a different direction we can take with this issue?