I have two index files under public_html. Apache is picking one with the .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 ....' set as the default order of files to look for when someone browses to your domain. You can change it to your choice. Say you want index.php to be loaded by default. Then you need to add the following line in your .htaccess file: 

DirectoryIndex index.php index.html index.htm

The .htaccess file is usually placed under the 'public_html' directory of your account. If it is not there, you can create one.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What are some basic software paths?

Sendmail: /usr/lib/sendmailPerl5: /usr/bin/perlServerpath: /home/username/public_htmlRoot path:...

How do I change File Permissions?

If you're new to scripting, or getting the dreaded "Internal Server Error" when you try to run a...

What is SSI (Server Side Includes) and how can I use it?

Server Side Includes (SSI) is a feature of CGI that enables you to dynamically insert a piece of...

Where do I place CGI scripts?

Although you can place cgi scripts in random directories throughout your site, it's best if you...

What is PHP and how do I use it?

PHP is a powerful server-side scripting language that can be used to extend the functionality of...