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.

Diable files listing in a directory.

Discussion in 'General Discussion' started by desiguru, Oct 15, 2009.

  1. desiguru

    desiguru Well-Known Member

    Joined:
    Aug 27, 2008
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    Whenever a new domain is created, each one has access to its list of files if index file is not created there.

    For example if a directory domain.com/home has four files

    xzy.php
    none.php
    hello.php
    sample.php

    When one goes to domain.com/home all of those files show up. How do I disable that for all of the hosts?
     
  2. egsi

    egsi Member

    Joined:
    Aug 12, 2009
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    One option is to create / edit your .htaccess file under the .../public_html folder and add the following line:

    Code:
    Options All -Indexes
    This will apply it to ALL subfolders under ..../public_html

    Would be nice to have cPanel enable this by default
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    1. Login to WHM as root
    2. Click Apache Configuration
    3. Click Global Configuration
    4. Uncheck the box labeled Indexec in the Directory '/' Options[/i]
    5. Click Save
    6. Click 'Rebuild Configuration and Restart Apache'
    7. Wait for restart
    8. Directory indexing is now disabled globally.
     
  4. desiguru

    desiguru Well-Known Member

    Joined:
    Aug 27, 2008
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6



    Awesome! That's exactly what I needed.
     
Loading...

Share This Page