Apache reports a No matching DirectoryIndex error when a requested directory has no recognised default page and directory listing is disabled. Check the expected index file and configuration before enabling any listing or changing server-wide defaults.
Check the expected page
- Identify the affected website and directory from the Apache error log.
- Check that the application files, such as index.php or index.html, exist in its correct document root and are readable by the web server.
- If the application uses PHP, confirm that a working PHP handler is configured. Adding index.php to a list does not install PHP.
Configure the directory index
Back up the relevant site configuration. In its existing Apache Directory context, or in .htaccess where permitted, set the intended order:
DirectoryIndex index.php index.htmlThis is an Apache directive, not a terminal command. Use the index file names required by the application and retain other site settings. On a control-panel server, use its supported configuration include process.
Validate and test
Validate administrator-managed configuration with:
sudo apachectl configtestIf successful, reload the appropriate Apache service, normally apache2 on Debian/Ubuntu or httpd on Red Hat-based systems. Visit the directory URL and confirm it serves the correct page. Do not enable public directory listing merely to hide a missing-index error.