--- /dev/null
+ *) mod_autoindex: Add "IndexForbiddenReturn404" to return 404 instead of a
+ 403 when Options does not included "indexes". [Eric Covener]
</usage>
</directivesynopsis>
+<directivesynopsis>
+<name>IndexForbiddenReturn404</name>
+<description>Return an HTTP 404 error instead of Forbidden when options
+don't permit directory listing</description>
+<syntax>IndexForbiddenReturn404 On|Off</syntax>
+<contextlist><context>server config</context><context>virtual host</context>
+<context>directory</context><context>.htaccess</context>
+</contextlist>
+<override>Indexes</override>
+<compatibility>Added in 2.5.1</compatibility>
+
+<usage>
+ <p>The <directive>IndexForbiddenReturn404</directive> directive controls whether
+ this module returns an HTTP 404 status code instead of an HTTP 403 status code when the
+ <directive>Options</directive> does not allow indexes to be returned. </p>
+</usage>
+</directivesynopsis>
+
</modulesynopsis>
int desc_adjust;
int icon_width;
int icon_height;
+ int not_found;
char default_keyid;
char default_direction;
AP_INIT_TAKE1("IndexHeadInsert", ap_set_string_slot,
(void *)APR_OFFSETOF(autoindex_config_rec, head_insert),
DIR_CMD_PERMS, "String to insert in HTML HEAD section"),
+ AP_INIT_FLAG("IndexForbiddenReturn404", ap_set_flag_slot,
+ (void *)APR_OFFSETOF(autoindex_config_rec, not_found),
+ DIR_CMD_PERMS,
+ "Return 404 in place of 403 when Options doesn't allow indexes"),
+
{NULL}
};
"Options directive",
r->filename,
index_names ? index_names : "none");
- return HTTP_FORBIDDEN;
+ return d->not_found ? HTTP_NOT_FOUND : HTTP_FORBIDDEN;
}
}