Finally, resolved this with a colleague.
By default, DirectoryIndex specified in httpd.conf does not work for us. Although our sequence is "index.html" and then "index.php", Apache2 will work with index.php first. Only when "index.php" is not present in the same folder, and then "index.html" is served.
We found 2 ways to overcome this:
Assuming your doc root is '/ var / www / html',
[Method 1]
1. Add a .htaccess to the root directory of your web app (eg / var / www / html / myapp).
2. Add the line 'DirectoryIndex index.html' to the .htaccess.
3. In httpd.conf, set 'AllowOverride' to 'All' under <Directory '/ var / www / html'>.
[Method 2]
1. In httpd.conf, add 'DirectoryIndex index.html' under <Directory 'var / www / html'>.
(note: this 'DirectoryIndex' is different from the default DirectoryIndex that is
not enclosed within any tag.)
Restart the web server.
Hope this helps someone. Thanks!
source share