index.php not loading by default

I have just installed CentOS, Apache and PHP. When I visit my site, it says “forbidden”. By default it’s not loading the index.php file.

When I visit, it works fine.

Any idea how to fix that issue?


Apache needs to be configured to recognize index.php as an index file.

The simplest way to accomplish this..

  1. Create a .htaccess file in your web root.
  2. Add the line…

DirectoryIndex index.php

Here is a resource regarding the matter…

I’m assuming apache is configured to allow .htaccess files. If it isn’t, you’ll have to modify the setting in apache’s configuration file (httpd.conf)

Leave a Reply

Your email address will not be published. Required fields are marked *