When people visit your site by default the server check for an existing index file to load that page as the default one.

Some examples of common index files are: index.html, index.htm, index.php, index.cgi, index.pl, default.html, etc. The supported index files depend on the how the server is set up.

If you have two files with names from that list, the web server will show the one that shows up first, for example index.html will show up, even if you have an index.php file in the same directory.

If the server is unable to find the index file it will try to display an index of all the files available in the directory. If you have disabled the directory indexing from your hosting account control panel then it will show the 403 forbidden error.

Using .htaccess you can change the default index file in your account.

Create (or edit if it exist) a file called .htaccess in the desired directory with the following line:

DirectoryIndex mypage.html secondchoicepage.html thirdchoicepage.php
Change mypage.html secondchoicepage.html thirdchoicepage.php to the page name that you would like as the default index page in your account.
Was this answer helpful? 0 Users Found This Useful (357 Votes)