0

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" ?

djangofan
  • 4,172
  • 10
  • 45
  • 59

1 Answers1

2

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.*.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • See this similar question. http://serverfault.com/questions/118917/reference-the-matched-directory-inside-an-apache-directorymatch-directive – Zoredache Dec 01 '11 at 21:28