Default Directory index page

When a request is made to a URL that points to a directory instead of an actual file within a directory, web servers will typically serve a default index page such as an index.html or index.php file. If this file does not exist on the server or the server is not configured to display this file, a list of all the files and directories located inside the current directory may be displayed.

Users can modify what index file is loaded by default when a directory is navigated to.

Directory index files on cPanel Hosting

Follow the instructions below to modify the default index page on cPanel Hosting accounts.

Please note that modifying the directory index file on a cPanel Hosting account requires users to modify their .htaccess file. If modified incorrectly, you could break your live website. It is recommended you backup your .htaccess file before attempting to make any changes to it.

  1. Log into your Account
  2. Find the cPanel in question and log in
  3. Click the File Manager icon
  4. Select Home Directory
  5. Tick the box next to Show Hidden Files (dotfiles)
  6. Click [Go]
  7. Navigate to the public_html directory
  8. If a .htaccess file exists, select it then click the Edit icon
  9. If no .htaccess file exists, click on the New File icon and create a file called .htaccess
  10. Type in the below code into your .htaccess file
#Example DirectoryIndex index.php index.html index.htm
DirectoryIndex filename
  1. If you want to add additional default index file options, you can add a space and include additional file names
    eg. DirectoryIndex index.php index.htm index.html Index.html
  2. Once done making the appropriate changes, click [Save Changes]

.htaccess files work recursively, meaning all the subfolders that do not have their own .htaccess file will listen to the directive given by the .htaccess file placed in the root directory.


Customer service
About Us
Contact Us
Support Centre
Resources
WHOIS
Legals
Sitemap
Follow Us
Copyright © Webcentral Pty Ltd, ABN 13 080 859 721. All rights reserved