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
- In cPanel, navigate to the File Manager.
- Open your public_html folder and create a file named ".htaccess"
- 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.