Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

How do I display directories correctly?

Discussion in 'General Discussion' started by aytimothy, Nov 21, 2013.

  1. aytimothy

    aytimothy Registered

    Joined:
    Nov 21, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    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?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,896
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. rijo.a

    rijo.a Member

    Joined:
    Oct 23, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    You can remove the index.html from the directory if you want to list the directory contents for the public.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice