Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: Emilio_k on February 22, 2012, 10:40:00 AM

Title: Password protect single files instead of directories *SOLVED*
Post by: Emilio_k on February 22, 2012, 10:40:00 AM
Hi,

I have been able to password protect a directory on my website using the 50AddSecureIbayFolder in my httpd.conf:

<Directory /home/e-smith/files/ibays/Primary/html/links/admin>
AuthUserFile /etc/htpasswd
AuthName "admin links"
AuthType Basic
<Limit GET>
order deny,allow
require user admin
</Limit>
</Directory>


But how do I would also like to password protect a single page (a .php file in this case).
Does anyone know how to do this?

Thanks.

Title: Re: Password protect single files instead of directories
Post by: Stefano on February 22, 2012, 11:40:15 AM
does apache have such a feature? if so, find how, then you're done..
Title: Re: Password protect single files instead of directories
Post by: mmccarn on February 22, 2012, 12:33:37 PM
Put it in a directory and protect that? (maybe with a symlink at the old location, ans FollowSymLins turned on)
Title: Re: Password protect single files instead of directories
Post by: Emilio_k on February 22, 2012, 01:19:24 PM
Ah,

<Directory /home/e-smith/files/ibays/Primary/html/links/admin>
AuthUserFile /etc/htpasswd
AuthName "admin links"
AuthType Basic
<Files admin.php>
require user admin
</Files>
</Directory>


seems to work :)