How do I change the default index page?


By default, if you request a directory (e.g. http://example.com/ or http://example.com/support/) Apache keeps a list of files it should look for (in order) before it should try and display the contents of the directory. Normally it isn't allowed to do this, and so will either give a 403 error warning, or, if you are requesting the initial page (such has http://example.com/) then you may see a 'Test Page' for Apache and CentOS.


This list of files is set in the master Apache configuration file (httpd.conf - for more information about it, see this article), and looks something like:


DirectoryIndex index.html index.shtml index.cfm index.php index.php3

Therefore, it will look for index.html first. If it cannot find that file, it try and look for index.shtml, and so on. However, if you have (for example) index.htm or default.html, then, as it is not in the list, it will not be called. To change this you will need to add your own DirectoryIndex command within a .htaccess file to extend the list.


Setup


Create a .htaccess file with the following contents (if you want to use index.htm) then upload it to the directory where you want this to work:


DirectoryIndex index.htm

Note that all sub-directories below the directory where you put the .htaccess file will also be affected by this change. Normally it's placed being placed in the doucment root (httpdocs/) so that it affects all directories on a website.


For more infromation on how .htaccess files work, see this article. Also, if you make a mistake with a .htaccess file, Apache will report a 500 error and your site will be unavailable until either you correct the mistake or delete the file. Only use this if you are sure of what you are going.


  • 98 Users Found This Useful
Was this answer helpful?

Related Articles

Why can't I access www.(example.com)?

Our servers are currently configurated using the Plesk Control Panel (versions 9.0.x). Within...

Can I host the same website using more than one domain?

Unfortunately, no. Plesk has a fixed system whereby each domain has it's own dedicated web...

Can I install programs such as phpBB and Mambo?

All our accounts provide access to a wide-range of languages and utilities Using these, you are...

Can I view my access and error logs?

By default, you can only view the access and error logs though the Plesk Control Panel. The...

How do I view the statistics for my website?

There are two ways to access the statistics generated by our systems. This solely depends on...