return index_directory(r, d);
}
else {
+ const char *index_names = apr_table_get(r->notes, "dir-index-names");
+
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
- "Directory index forbidden by "
- "Options directive: %s", r->filename);
+ "Cannot serve directory %s: No matching DirectoryIndex (%s) found, and "
+ "server-generated directory index forbidden by "
+ "Options directive",
+ r->filename,
+ index_names ? index_names : "none");
return HTTP_FORBIDDEN;
}
}
return error_notfound;
}
+ /* record what we tried, mostly for the benefit of mod_autoindex */
+ apr_table_set(r->notes, "dir-index-names",
+ d->index_names ?
+ apr_array_pstrcat(r->pool, d->index_names, ','):
+ AP_DEFAULT_INDEX);
+
/* nothing for us to do, pass on through */
return DECLINED;
}