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? Quote 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! Quote 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 :( Quote 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) ....... ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.