htaccess sub directory deny from all

Discussion in 'Apache' started by ignas2526, Apr 27, 2009.

  1. #1
    Hello,
    The thing i trying to do is to deny any access to sub directory from root directory, but leave root directory accessible,
    the htaccess file is in / and i want to deny access to /dir1/ and /dir2/ i know what i can place in each sub directory htaccess file with "deny from all", but there must be way to do it from root directory...
    How to do that?
    Thanks.
     
    ignas2526, Apr 27, 2009 IP
  2. Lpe04

    Lpe04 Peon

    Messages:
    579
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    well, you could try something like

    
    RewriteCond %{REQUEST_URI} (dir1 | dir2)
    Rest of code here
    
    Code (markup):
    Hope this helps.
     
    Lpe04, Apr 27, 2009 IP