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:
DirectoryIndex index.html
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:
In this case, add index.php to the DirectoryIndex directive.
vim /etc/httpd/conf/httpd.conf
Change the below line:
DirectoryIndex index.html
to:
DirectoryIndex index.html index.php
Now exit and save the file using the command :wq .
Ensure to restart Apache:
systemctl restart httpd
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