My web server is Apache. I have disabled directory listings via an Options -Indexes directive in a .htaccess file, so if a user navigates to a directory without an index.html file, he’ll get a 403 Forbidden error. However, I’d like to return 404 Not Found in such instances instead. Is that possible?
My web server is Apache. I have disabled directory listings via an Options -Indexes
Share
You can use
to override 403 with your own script, and make it return 404. for example, in PHP: