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.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Is it possible to run Microsoft Access on my server?

It is not possible to run Microsoft Access databases on a Linux or FreeBSD server. You may want...

How do I move my mysql database from a Upipe hosting account to a WebPro hosting account?

To move a database from a Upipe hosting account to a WebpPro hosting account follow these...

Troubleshooting PHP Scripts

If you cannot figure out the problem with your script from the error message, check these things...

What does PHP 'safe mode' mean? Why do you use safe mode?

When possible, we use PHP in safe mode to provide higher security for our shared hosting...