Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Using Apache, is there a way to protect all items beneath directory names that contain a certain string?

For example, if I have this structure:

wwwroot-->
  project1-->
    docs-->
        xls
        doc
          private_docs-->
            txt
        txt
    private-->
        pdf
        doc
  project2-->
    docs-->
        log
        txt

Is it possible to user password protect all directories that contain the word "private" ?

share|improve this question

1 Answer 1

It sure seems like you need to place your authorization configuration in either a LocationMatch or DirectoryMatch container.

The match expression might look something like ^/.*/private.*.

share|improve this answer
    
See this similar question. serverfault.com/questions/118917/… –  Zoredache Dec 1 '11 at 21:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.