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 need to create an authentication exception for specific folders on my Apache server.

We have a blanket password protection across our whole domain, but this prevents Wordpress from uploading files and creating folders with it's Flash uploaders. Also any upload methods from plugins are failing too with HTTP Error 401.

Is there any way to make an exception for /wp-admin and /wp-content folders specifically?

That way, I can add the exception to any subdomains we make that use wordpress.

I've seen many examples of doing this with IPs using Allow From, but not with folder names...

share|improve this question

You can specify this using the LocationMatch directive. For full details you can read the Apache Docs for LocationMatch, but what you probably want it something like this:

<LocationMatch /wp-(admin|content)>
  Allow from all

This should match any URLs containing either the string /wp-admin or /wp-content and apply the access restrictions Allow from all to them.

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.