0 items
24/7 Support & Sales   1300 210 210
Online Support Web Hosting

How to change the default Index page in .htaccess

If you visit a web address that contains a domain name only, the default index page will display as the first page. If there is more than one index file, the server will follow its default order, which is index.htm, index.html, index.php, and then default.htm

You may change your default index page by altering the .htaccess file, especially if you have a customised name for your index file. This will also avoid internal links from being broken on your site.

Change your default index file in .htaccess by following the steps below:

  1. Click on My Account at the top of this page.
  2. Select Hosting Manager from the drop-down menu.
  3. Enter your username and password and click Log In.
  4. On the Home page, click on the File icon, or the [ v ] arrow button on the right side, and then click File Manager.
  5. Select Web Root (public_html/www), and make sure to tick the box Show Hidden Files (dot files).
  6. Click Go.
  7. Locate .htaccess file, right click on it, and select Edit.
  8. A text editor popup will display, just click Edit.
  9. The .htaccess editor will appear. Paste the following code at the top of the page, and replace mypage.html with the file name of your index page.
    #Alternate default index page 
    DirectoryIndex mypage.html
    You can add more than one file if you want. The server will just read it from left to right. For example, we can add index.htm, index.html, and index.php from the code above. The server will now check for mypage.html first. If it does not find a file with that name, it continues to index.htm and so on.
  10. Click Save Changes at the upper right corner of the page.

Congratulations! Your default index page is now changed.

If you want to know what is an .htaccess file, click here.

If you want to know how to show .htaccess (hidden files), click here.

Was this helpful? Yes No 60% of people found this helpful.