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.

I'm blocking all access to files on

<Directory /var/www/*>
    Allow from None
    Order allow,deny
</Directory>

With except to the following two files

<Location /subdir/file.php>
      Order allow,deny
      allow from all
</Location>


<Location /subdir2/file2.php>
      Order allow,deny
      allow from all
</Location>

Is there any way I can allow access to both these files from the same directive like

<Location /subdir/file.php, /subdir2/file2.php>
      Order allow,deny
      allow from all
</Location>

So I don't need to create a new <Location> directive for each file

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted
<LocationMatch "^/subdir/(file\.php|file2\.php)$">
    Order allow,deny
    allow from all
</Location>
share|improve this answer
add comment

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.