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 have a testing site which has a Require valid-user directive, employing Apache's mod_auth to keep it private, but I'd like to exempt a single file from this requirement (i.e. make it so that you don't need a username / password to access that one file, even though you need a username/password for the rest of the site).

Right now, I have...

AuthUserFile /path/to/htpasswd
AuthType Basic
AuthName "My Private Site"
Require valid-user
<Files filename.txt>
  Allow from All
  Satisfy Any

But that doesn't seem to quite be doing the trick (I can see the file, but only after being prompted for a username/password and clicking cancel).

What am I doing wrong?

share|improve this question
See.… for how to hack this. – Mark Wagner Mar 23 '11 at 21:07

I think something like this should work:

<FilesMatch "^/path/to/file$"> 
Allow from all 
Satisfy any 

You could also try the <location> directive instead of the <FilesMatch> directive.

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.