Password protection and WordPress permalinks issue. How to fix it?

When you want to password protect a subfolder of your account, if there is a WordPress application installed in the public_html folder, the rewrite rules of the WordPress application will most likely negate the password protection.

To have the folder properly protected, you need to edit the .htaccess file in your public_html folder and change the bold line below:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

to

RewriteRule ./ /index.php [L]

Once you modify this rewrite rule, the password protection of the inner folder should be working as expected. You should clear the cache of your browser and check the modifications on your end.

If you want a lightning-fast WordPress website, check out our free eBook WordPress Speed Optimization Ebook! In it you will find a variety of easy-to-follow tips to improve the speed of your site!