How do I change Apache's original index file

If an index file is missing in a folder, apache uses its own file/files to list the contents of the folder.

Since I don’t want to create an index file in every folder in the file systems, I wonder where I can find the file/files that apache uses when there is no index file.

Best regards

This would be the DirectoryIndex directive in the conf file.

<IfModule dir_module>
    DirectoryIndex index.php index.cgi index.asp index.shtml index.html index.htm \
    default.php default.cgi default.asp default.shtml default.html default.htm \
    home.php home.cgi home.asp home.shtml home.html home.htm

If I delete all that is next to DirectoryIndex, the contents of the folder will still be displayed.

So apache has its own file behind it and that is the file I want to edit. But I don’t know where it is.

If it is possible to specify an index.php file that also applies to all subfolders,
it could also be a solution…

oh sorry. I see what you meant.

The file should be sitting in the DocumentRoot.

Looking for ErrorDocument ?

Instead of a user seeing a list of folder contents or a generic Apache error message you can send a response to something more helpful, eg. home, sitemap, search, your own string etc. Just be sure to return the correct HTTP headers if you care about that.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.