KnowledgeBase Glossary    Contact Us
Browse by Category KnowledgeBase .: ASP/PHP/Database Issues .: Can I change the default starting file for my website (i.e. index.php instead of index.html)?

Can I change the default starting file for my website (i.e. index.php instead of index.html)?

The easiest way is to simply rename or remove any other index files other than the one you want to use.

If this is not practical for your site you can set page "priorities" is by modifying the order of the available index files in the server's httpd.conf if you have a VPS account. You can also make these changes for a specific set of directories in a .htaccess file. You can specify this order by creating a plain text file named .htaccess containing the following line:

DirectoryIndex index.php index.html index.htm index.shtml

This directive lists several files that can be loaded, in decreasing order of priority. (In the above example, the system will attempt to load index.php first; if it's not there, index.html will be loaded, and so on through index.shtml.) If you require files to be tried in a different order, change the order in the above line to reflect your site's needs.

Once you've created the above .htaccess file you can then FTP it to your site's /web directory and it will immediately take effect.

Keep in mind that adding directives to .htaccess files causes the server to have to read an additional configuration file every time a file is accessed from your site, so the method of removing or renaming the pages should be used if possible.

How helpful was this article to you?

Related Articles

article Why is my index.htm file not displaying?
This problem is likely due to a...

  1-4-2006    Views: 8347   
article How can I stop file directory listings?
The easiest way to stop the directory indexing...

  7-22-2005    Views: 11664   
article How to change the default character set for a website
To change the default character set for all...

  5-3-2006    Views: 23991   

User Comments

No comments have been posted.

.: Powered by Lore 1.5.4
Copyright 2005-2014 Advantagecom Networks, Inc. - Xen Linux Virtual Private Servers (VPS) - Paypal Accepted