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.

Directory Structure?

Discussion in 'General Discussion' started by moetus, Apr 27, 2006.

  1. moetus

    moetus Registered

    Joined:
    Feb 12, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Is there an option in cpanel of turning off the directory structure of directories from the browser.

    When I look at all my websites I can see a list of files in directories that do not contain the index.html file.. how can I prevent this? Is there a solution in cpanel?

    Thank you in advance for the help
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Edit or create a .htaccess file in the directory that you do not want its contents listed. Add the following line to this file:

    Code:
    Options -Indexes
    This turns off Indexes on this directory and prevents the file and directory structure from being displayed for that directory. Instead you'll get a 403 Forbidden error.
     
  3. moetus

    moetus Registered

    Joined:
    Feb 12, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    can this be done globally for all websites? instead of just one website?
     
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I suppose you could edit the main httpd.conf file and write this in and save the file. The file is at:

    /etc/httpd/conf/httpd.conf

    And add something like:

    Code:
    Options -Indexes
    or

    Code:
    <Directory /home>
    Options -Indexes
    </Directory>
     
Loading...

Share This Page