htaccess password protect a subfolder
-
I am trying to use htaccess to password protect a subfolder of my WordPress site.
Ideally, I would like to be https://www.website.com/protected-folder/, but I am getting a 404.
I have moved my folder to the wordpress directory, making it https://www.website.com/wordpress/protected-folder, but I am still getting a 404.
The htaccess file in my protected folder has this:
AuthType Basic
AuthName “Board Memebers”
AuthUserFile /.htpasswd
require valid-userThe htaccess in my wordpress directory is
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule># END WordPress
But I am still getting a 404 error.
Please help.
- The topic ‘htaccess password protect a subfolder’ is closed to new replies.