How can i change my default index page in my hosting account?

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.



  • 0 Users Found This Useful
Was this answer helpful?
Related Articles
Copyright © 2020 PlusPlusHosting.Net. All Rights Reserved.
2Checkout.com is an authorized reseller of goods and services provided by PlusPlusHosting.Net.