WordPress Development Stack Exchange is a question and answer site for WordPress developers and 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'm familiar with password protecting files and directories using apache authentication. I am working on a site where I have two WordPress installs on the same domain. One WP install is in the root /public_html/ another one is in a sub directory. We do NOT want to merge the user database this is why we are using separate WP installs.

The issue is I want to password protect wp-login.php file on the main install, but not on the sub directory install.

I went ahead and added the following code to my .htaccess file in my public_html directory.

AuthName "Admins Only"
AuthUserFile /path/to/passwd
AuthGroupFile /dev/null
AuthType basic

<Files wp-login.php>
require valid-user

The issue is that this code blocks it for both the main WP site and the sub directory wp-login.php file.

I was hoping if there is a way that I can add in my /folder/.htaccess which will keep the other WP install open for login by anyone.

Let me know

share|improve this question
up vote 1 down vote accepted

Ok guys, I did further research. Basically, all I had to do was add "Satisfy Any" argument. So the main .htaccess file looked like the one I posted in my initial thread. Then for the specific folder, I created a new .htaccess file (/folder/.htaccess).

Then added this:

<Files wp-login.php>
Satisfy Any

Much thanks to this thread on StackExchange

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.