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'd like to deny access to /arch.1, but not to for example /dir1/arch.1

What I've tried is:

<FilesMatch "^(arch.1|arch.2)$">
   Order deny,allow
   Deny from all
</FilesMatch>

but it match every file any_dir/arch.1 and using ^/ in the beginning is not working. I don't want to use a .htaccess file.

Could you help me please?

share|improve this question
2  
I strongly suggest that you review the relatively good documentation on access control in httpd.apache.org. –  mdpc Nov 13 '12 at 18:39
add comment

1 Answer

You are using the wrong directive. You want <DirectoryMatch>.
Related: How directory, location and files directives work.

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.