Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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
I strongly suggest that you review the relatively good documentation on access control in – mdpc Nov 13 '12 at 18:39

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

share|improve this answer

Your Answer


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.