"how to make apache serve index.php instead of index.html?" Code Answer


As others have noted, most likely you don't have .html set up to handle php code.

Having said that, if all you're doing is using index.html to include index.php, your question should probably be 'how do I use index.php as index document?

In which case, for Apache (httpd.conf), search for DirectoryIndex and replace the line with this (will only work if you have dir_module enabled, but that's default on most installs):

DirectoryIndex index.php

If you use other directory indexes, list them in order of preference i.e.

DirectoryIndex index.php index.phtml index.html index.htm
By biaze-b1c8a22e133a on December 14 2022

Answers related to “how to make apache serve index.php instead of index.html?”

Only authorized users can answer the search term. Please sign in first, or register a free account.