I have two index files in public_html directory but Apache is picking one with .html extension. How can I change its order?

Apache’s ‘DirectoryIndex’ directive is used for this purpose. On our servers we have ‘index.html index.htm index.php ….’ order. You can change it according to your choice. Say you want index.php to be loaded by default then you need to add the following line in .htaccess file.

DirectoryIndex index.php index.html index.htm

The .htaccess file is usually placed under ‘public_html’ directory of your account. If it is not there you can create one.