The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  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