Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
</Files>

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
add comment

1 Answer

up vote 0 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
</Files>

Much thanks to this thread on StackExchange

share|improve this answer
add comment

Your Answer

 
discard

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.