How do I make Apache automatically load "index.php" files, the same way it loads "index.html" files?
You will need to be root to do all of the following.
- Go to the directory where the apache configuration files reside, typically in "/www/conf/".
- The file you will need to edit will probably be "httpd.conf". To be sure you are editing the correct file, grep the configuration files for "index.html", since you will want "index.php" to have the same behavior:
niflheim: grep index.html *.conf
httpd.conf: DirectoryIndex index.html
- Edit the appropriate file (httpd.conf) and search for "index.html".
- You should see the following line:
Add "index.php" so that it occurs one space after "index.html".
- Your file should ultimately look like this:
DirectoryIndex index.html index.php
- Save the file and restart Apache with the following sequence of commands:
niflheim: cd ../bin/
niflheim: ./apachectl restart
- Your "index.php" files should now load by default.
Still have a question?
Didn't find what you were looking for? Do you still have a question you need an answer to? Just click here to send us a message, and a memeber of our staff will contact you shortly.