How to fix - Apache Error: No matching DirectoryIndex?

You may face the below error while accessing applications that have index files other than index.html/index.php or other specified directory indexes.

Apache Error: No matching DirectoryIndex?

Please refer to the following in order to fix the issue. 

By default, Apache is configured with the following directory index.

<IfModule dir_module>
DirectoryIndex index.html

It means that Apache will only look for directory index files that are named index.html. So, whenever we attempt to access phpMyAdmin, Apache throws an error.

In order to resolve this issue, we will need to add index.php  file as a DirectoryIndex.

  1. Run the command.

    vim /etc/httpd/conf/httpd.conf
  2. Above command will open the configure file and we will need to add below line in the configuration file.


    <IfModule dir_module>
    DirectoryIndex index.html

    <IfModule dir_module>
    DirectoryIndex index.html index.php

    Once you add “index.php” in the configuration file, exit from the editor and save the file. Please note that we have changed configuration files so we will need to restart the Apache service. For that follow below command:

    systemctl restart httpd

    Your error should have gone now. So, this is how you can resolve the DirectoryIndex error.

Related Articles

How to Manage Linux VPS (SSD and Traditional) From Client Area?

This article will assist you to manage your Linux VPS (SSD and Traditional) from client area...

How to kill a process on Linux using command?

There might be an issue with applications that can be hung and not working properly. In this...

How do I enable apache file and directory indexing in Linux or UNIX?

There are 2 ways to enable apache file and directory indexing. Using Apache config file : You...

On which platform Linux VPS are configured?

We configure Linux VPS on XEN virtualization technique. However, Linux Cloud VPS are configured...

How to Deploy Laravel Application with Nginx on Ubuntu?

Laravel is a PHP Framework and Nginx is a Web-Browser which can be installed on Ubuntu. Nginx is...

  • 0 Users Found This Useful

Was this answer helpful?