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

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress


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.


Leave a Reply