If you have installed WordPress in public_html and want to protect a subfolder with the password you will need to modify the .htaccess file in public_html:
from
RewriteRule . /index.php [L]
to:
RewriteRule ./ /index.php [L]
Don't forget to clear your browser's cache.
