How do I display directories correctly?

aytimothy

Registered
Nov 21, 2013
1
0
1
cPanel Access Level
Website Owner
Hi, I'm new to the forums, so please pardon me if I unknowingly posted this in the wrong part of the forum.
So, here's the problem:
I'm not very sure how the directory system for cPanel works, but when I use my website, I want for example,
ie. You want to visit help.html. You should be able to just type domain.com/help, but instead, it shows the domain.com/index.html NOT domain.com/help.html.

So, I've did a bit of searching and I've found that people have been claiming that opening the name of a directory opens the index.html in that directory by default:
ie. You want to visit help.html. You should be able to just type domain.com/help, but instead it shows domain.com/index.html rather than domain.com/help/index.html OR domain.com/help/help.html.

On top of that, I've have a few file-only directories, which on default (before I placed any .html documents onto it) when I typed the website, it listed the contents of .../public_html, but now it doesn't. Everything now just displays .../public_html/index.html or domain.com/index.html.

My question is: How do I do that?
as I want to make certain directories list their index.html (or redirect to another file ie. domain.com/help goes to domain.com/help.html rather than domain.com/help/index.html)) when it is typed while others simply list their contents?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello :)

You can modify the default DirectyIndex value by placing a line in the .htaccess file of the directory you want to modify it for. EX:

Code:
DirectoryIndex help.html index.html index.php
The above example would ensure that the "help.html" file will load when the directory is accessed.

Thank you.