[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Protecting single files via .htaccess ?



On Mon, 14 Aug 2000, Oliver Schoenknecht wrote:

> I want to protect single files from accessing them from outside. I am
> aware that .htaccess does quite well in protecting directories but can
> I protect single files as well, for example the "passes.php3" ?
> 
> Any help is appreciated very well !

In the Un*x world everything is possible :)

Just add the next lines to your access.conf or httpd.conf

<location /passes.php3>
AuthType basic
AuthName "private"
AuthUserFile /etc/apache/pwapache
require valid-user
order allow,deny
allow from all
</location>

and restart apache, you can add a user to the passwd file with the
htpasswd command.

--
Staf Wagemakers

email      : staf@digibel.org
homepage   : http://www.digibel.org/~staf



Reply to: