PDA

View Full Version : .htpasswd question


fred2028
09-10-2009, 02:31 PM
OK so I can protect a subdomain (http://www.area51.fredfx.com) with .htaccess and using my host's cPanel X's password protect directory feature. I put the following
AuthGroupFile /dev/null
AuthName "Enter password for gate 1 of 340241413"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>
AuthUserFile "/home/fredfx/.htpasswds/public_html/subdomains/area51/passwd"

in my .htaccess file under my subdomain, and I'm just wondering if I'll need to do the same to other .htaccess files if I wanted to protect other directories (above this folder), or will this 1 .htaccess file suffice?

angst
09-10-2009, 07:55 PM
if this file is in a sub folder off the root and you want to protect other sub folders off the root, then yes, you will need an .htaccess file for each sub folder.

however if you are trying to protect sub folders within the area51 directory, then the one .htaccess file will be fine.