.htaccess not letting to view folders

Discussion in 'Programming' started by hip_hop_x, Dec 30, 2007.

  1. #1
    How can I not let people to see the folders inside a main folder, even if I chmode the main folder to 777?
     
    hip_hop_x, Dec 30, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    If you want to deny listing to everybody, add this to tou .htaccess file:
    
    Options -Indexes -Includes
    
    Code (markup):
    And if you want to allow listings for authorized people, add this
    
    AuthUserFile /path_to_your_directory/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Limited Access"
    AuthType Basic
    <Limit GET POST>
    require valid-user
    </Limit>
    Options All MultiViews
    
    Code (markup):
    With this method you need to create a .htpasswd file and fill them properly.
     
    ajsa52, Dec 30, 2007 IP
  3. hip_hop_x

    hip_hop_x Active Member

    Messages:
    522
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #3
    i want to let acces only to the server to acces the files, then getting from there and make a download start.
    Options -Indexes -Includes
    Code (markup):
    is this the good one for what I'm looking? Script isn't complete, and I can't test it.
     
    hip_hop_x, Dec 30, 2007 IP
  4. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #4
    You can test it easily: Create a directory a put the .htaccess file there
    Then if you try to access that directory through your browser, you'll get a 403 HTTP error similar to:
    "You don't have permission to access /yourTestDirectory/ on this server".
     
    ajsa52, Dec 30, 2007 IP