wordpress – htaccess password directory affects all pages

I trying to password protect a specific folder under the wp main root directory…
what happens here is that the pop-up password appears on all pages of my website.

the main htaccess is the wp default:

Read More
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

and the htaccess on my specific folder is:

AuthType Basic
AuthName "whatever-name-here"
AuthUserFile "path-to-my-passwd"
require valid-user

Can you help me please?

Related posts

Leave a Reply

1 comment

  1. Try,

    <Files /PathToDirectory/*>
    AuthType Basic
    AuthName "whatever-name-here"
    AuthUserFile "path-to-my-passwd"
    require valid-user
    </Files>