Forum

Password protect a file

Andrew H
13 October 2015, 04:12
Hi Hugo,

Sorry if this has been answered somewhere but if so I haven't been able to find it :-)

In apache I have an .htaccess file with the following to password protect wp-login.php:
AuthUserFile /var/www/passwords/caaht3
AuthName "Please enter password"
AuthType Basic
<Files "wp-login.php">
require valid-user
</Files>

In Hiawatha I've used passwords to protect directories like so:
Directory {
Path = /usr/share/nagios3/htdocs
PasswordFile = basic:/etc/nagios3/htpasswd.users
}

But how do I password protect a file rather than a directory?

Cheers,
Andrew
Andrew H
13 October 2015, 04:15
And of course as soon as I post this I see a question similar.

Please ignore this, I'll read that topic :-)
Hugo Leisink
13 October 2015, 09:28
Ok.
This topic has been closed.