Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Fix the Apache Error "No matching DirectoryIndex"

This guide explains why Apache shows a 403 Forbidden error with this message in the log, and how to fix it.

Web Hosting2 min read10 steps

What does the error mean?

Apache is the program that serves websites. When someone visits a folder on your site, for example yourdomain.com/, Apache looks for a starter page inside it. This page is usually called index.html or index.php. That name list is called the DirectoryIndex.

If none of those files exist, Apache has nothing to show. If listing the folder is also not allowed, it shows an error. In the log you will see a line like this:

No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive

Visitors see 403 Forbidden.

Common causes

  • You uploaded your site to the wrong folder.
  • The home page file is named wrongly, for example Index.html with a capital I. Linux cares about capital letters.
  • The file is inside another folder, so it is not at the top level.
  • The upload did not finish.
  • An old setting in .htaccess changed the list of home page names.

Steps to fix

  1. Log in to cPanel and open File Manager.
  2. Go to public_html. This is the folder for your main site. Addon domains may use their own folder.
  3. Look for index.html, index.php or similar.
  4. If the file is missing, upload it or move it to this folder.
  5. If the name is wrong, right-click the file and click Rename. Use lowercase, like index.php.
  6. Reload your website with a hard refresh (Ctrl and F5).

If the file has another name

Say your home page is home.html. You can tell Apache to look for it.

  1. In File Manager, click Settings and tick Show Hidden Files.
  2. Open .htaccess in public_html. Take a copy of it first.
  3. Add this line.
    DirectoryIndex home.html index.html index.php
    It tells Apache which names to try, in order.
  4. Click Save Changes.
Tip: You can show a folder list by adding Options +Indexes. But this lets anyone see your files, so it is usually a bad idea.

Still stuck?

Check folder permissions. Folders should usually be 755 and files 644. If it still fails, open a ticket at https://secure.hostvento.com/submitticket.php.

Quick recap

  • Apache needs a home page file like index.html in the folder.
  • Check the folder, spelling and capital letters.
  • Add a DirectoryIndex line if your file has another name.
  • Avoid turning on folder listings.