You wish to password protect a subdirectory using the cPanel icon (or a .htpasswd file), but you have WordPress installed in public_html with permalinks enabled. This causes your password protection to never work. The solution is simple.
- Login to your control panel's File Manager, or just connect to your domain with FTP.
- Edit the .htaccess file in your WordPress home folder (public_html) and remove the line shown in bold.
Example:# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress - Replace that line with this new line:
RewriteRule ./ /index.php [L] - The final code segment will look like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ./ /index.php [L]
</IfModule>
# END WordPress
Now it's fixed.