mikeantiga
Posts: 753
Joined: 28 Mar 10
Trust:
04 Feb 11 1:16 am
Just want to add that you can actually configure your preferred index file by adding the following line to your .htaccess file:
The code above directs the server to load the only 'index.php' file so even if you have an index.html file in the same directory, the server will just show the index.php. This particularly applies to the Premium Hosting where a blank index.html is automatically created when you setup a domain name. This causes the website to give a blank page even if you've already uploaded the website files to the server. Remember that if you have two index files in your public_html (e.g. index.php and index.html), the server will choose load index.html first (this is the default setting on almost all web hosts). Adding the code above will tell the server which file to look for when the domain is accessed.
Another solution is to set the order of your index files by adding the code below:
The second code tells the server to display the 'index.php' file as the directory index, and if this file is not available then display 'index.html', and so on. You can put an 'under maintenance' notice in the index.html so that if ever your index.php got deleted for some reason, your visitors won't see a page not found 404 or a directory list of your website files.