Directory Index Editing

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.

  • 35 Users Found This Useful
Was this answer helpful?

Related Articles

Do you offer password protected directories?

By default, cPanel allows you to password protect directories in your account that you wish to...

Why can't I log into my cpanel or webmail?

There various issues that you may not be able to login to your cPanel or WebMail. We have...

Custom Error Pages

Creating your own error pages can be accomplished through cPanel. After logging in, under...

Requesting a New cPanel Password

Resetting Your cPanel PasswordYou can reset your cPanel password from the cPanel login screen....

Secure cPanel Login

Using Shared SSL to Access cPanel Use https, enter your site's IP address, and the secure port...