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 basic auth set for Directory / and want to exclude Location /assets/upload, but it just won't work, I have tried several options and tutorials.

This Location directive clears the Directory auth config and disables basic auth for the whole website:

<Directory "/">
    AuthType Basic
    AuthName "Staging"
    AuthUserFile /var/.../.htpasswd
    AuthGroupFile /dev/null
    Require valid-user

<Location "/">
    Order deny,allow
    Allow from all
    Satisfy any

However, I just want /assets/upload to be without basic auth, but if I change the 1st parameter of Location to /assets/upload, the whole page, including /assets/upload is protected by basic auth...

<Location "/assets/upload">
    Order deny,allow
    Allow from all
    Satisfy any

What could be wrong here?

Version: Apache/2.2.16 (Debian)

share|improve this question

In the /assets/upload directory, put another .htaccess file with these contents;

Allow from all
Satisfy any

This will override the more general settings of the file in the directory above it, and serve assets without requiring authorization.

share|improve this answer
I can't put a .htaccess there as I am using the CakePHP framework - the initial request will always be to the index.php file. That's also the reason why I can't use the Directory but Location directive instead to disable auth basic for /assets/upload... – mrtn. Feb 6 '13 at 0:39

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.