If you are looking for a useful solution to address Apache Error: No matching DirectoryIndex, you are in luck. In today’s blog, we will bring the simplest method to handle this problem.

Why do you see the “Server-generated directory index forbidden by options directive” error?

Usually, you will get the “server-generated directory index forbidden by options directive” message when Apache attempts to access applications. But it can not find the file “index.html” and will only get the “infdex.php” file instead. However, by default, Apache is not configured to load this file. Therefore, the Web server will not know which file to serve when the user accesses the relative link.

For example, phpMyadmin uses the “index.php” file after installing instead of using an “index.html” file.

Whereas, by default, Apache is configured with Directoryindex as follows:

<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

As a result, Apache can only find directory index files that are named index.html. So, how to handle this error? In today’s blog, we give you an easy method to eliminate this error effectively. Let’s keep reading.

How to tackle the “Server-generated directory index forbidden by options directive” error

In order to get rid of this message, we need to add “index.php” to the DirectoryIndex directive.

vim /etc/httpd/conf/httpd.conf

Then, change the following line:

DirectoryIndex index.html

To:

DirectoryIndex index.html index.php

Now, you can save your change and restart Apache to check the error is gone.

Summary

Congratulations, your problem has just been handled. Hopefully, we provided you with a useful blog. If you have any problems, or the error still appears, please let us know by leaving a comment below to get assistance.

Besides that, there are a wide array of eye-catching, easy-to-use, SEO-friendly designs on our Free WordPress Themes website. It is a great chance for you to get your desired theme for your successful website.

 

5/5 - (2 votes)
LT Digital Team (Content & Marketing)
Latest posts by LT Digital Team (Content & Marketing) (see all)
All-In-One Membership Access PRO version of all 500+ all Joomla! templates and WordPress themes. Just from $7.25/MO Learn more
🎉 Merry xMas & Happy New Year sale! Grab 50% Off for everything on today, don't miss it. Coupon code: XMASNEWYEAR Redeem Now