Knowledge Base
MilesWeb / Web Hosting FAQ

How to Resolve the Apache Error: No matching DirectoryIndex?

Approx. read time : 2 min

For this tutorial, you need to have root access and so, this can be done only on VPS, Dedicated and Cloud.

You might face this error while attempting to access applications that have an index.php file (or other index file), but not an index.html or other specified ‘directory index’ file.

For example, phpMyAdmin comprises of index.php file after installation, but not an index.html file.

Apache is by default configured with the below command:

It means that Apache will only check for the directory files that are named index.html.

While trying to access phpMyAdmin, Apache gives the below error:

[autoindex:error] [pid 20115] [client] AH01276: Cannot serve directory /usr/share/phpMyAdmin/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive

In this case, add index.php to the DirectoryIndex directive.

Change the below line:


Now exit and save the file using the command :wq .

Ensure to restart Apache:

Congratulations! You have now learned to solve the Apache Error: No matching DirectoryIndex.

Also Read
Steps to Modify Apache Directory Listing Style
Learn to Restart Apache on Dedicated Server

Pallavi Godse
Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.