marafa Posted April 13, 2003 Report Share Posted April 13, 2003 how do i password protect a web directory via apache? i think its with .htaccess but m not sure. could someone help me with the syntax and such? Link to comment Share on other sites More sharing options...
Guest bradenm Posted April 15, 2003 Report Share Posted April 15, 2003 OK, first put this in .htaccess of the dir you want to protect: AuthUserFile /home/[your user name here]/.htpasswd AuthGroupFile /dev/null AuthName "Descriptive name of the protected area" AuthType Basic <Limit GET POST> require user joe require user pete </Limit> In the above you need to change AuthUserFile, AuthName, and change the words "joe"/"pete" etc. to usernames that you want to allow. Next, run the command "/usr/sbin/htpasswd -c ~/.htpasswd [user name]" to set the password for each user. I think that that's it! Link to comment Share on other sites More sharing options...
marafa Posted April 17, 2003 Author Report Share Posted April 17, 2003 yes thanks as soon as my host allows .htaccess i will implement it :( Link to comment Share on other sites More sharing options...
paul Posted April 17, 2003 Report Share Posted April 17, 2003 use php then. <? if($PHP_AUTH_USER=="myuser" && $PHP_AUTH_PASS=="mypass) ....... ?> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now