Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.