Knowledgebase: cPanel/WHM/Linux
The DirectoryIndex directive sets the list of resources to look for
Posted by Noah Strehl on 01 September 2009 06:30 PM
Log into the domain you want to change the default file on (Use the File Manager in cPanel or via SSH). Locate the .htaccess file and add this line at the top:
DirectoryIndex <filename.extension>


DirectoryIndex index.html

Then a request for http://myserver/docs/ would return http://myserver/docs/index.html if it exists, or would list the directory if it did not.
This is now your default file.

More info on this directive can be found on the Apache Documentation page.
(84 vote(s))
Not helpful

Comments (2)
02 March 2012 01:29 PM
Doesn't work
Michael Carr
26 March 2012 06:35 PM
Hi Robert,

Sorry to hear it is not working for you, the syntax does appear to be correct though. If you are having issues please feel free to contact our support by phone, chat or email 24x7x365 and we will take a look for you.
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).