Directory Index Editing Print

  • 35

Directory Index Editing

The Directory Index is an .htaccess code that specifies the default page for your domain name. The .htaccess file is recursive - if you place it in your main folder it will affect all subfolders which do not have their own .htaccess file. If you wish to make an .htaccess file for an addon or subdomain, you will need to place it into their document root folder.


How to Edit the Directory Index

  1. In cPanel, navigate to the File Manager.
  2. Open your public_html folder and create a file named ".htaccess"
  3. Insert the code taken from below.

 


Codes

To make "filename.ext" your default page, enter this code:

DirectoryIndex filename.ext


If you wish to have your site look for alternative default pages if the first option isn't available, enter the following code.

DirectoryIndex home.html index.php index.shtml page1.php


When a visitor loads your site, the site will first attempt to serve up home.html. If it does not find home.html, it will look for index.php. Failing that, it will look for index.shtml, and then page1.php.


Was this answer helpful?

« Back