phpcode Posted January 8, 2008 Share Posted January 8, 2008 I'm trying to protect a folder but I cannot get it to work. Heres what is in my htaccess file: AuthUserFile C:\Program Files\Apache Software Foundation\Apache.htpasswd AuthGroupFile /test AuthName EnterPassword AuthType Basic require user test And htpasswd: test:4OCLqrtvRV4w2 I've restarted the server but that didn't do anything. Does anyone know what I'm doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/85082-solved-password-protect-folder/ Share on other sites More sharing options...
madmax Posted January 8, 2008 Share Posted January 8, 2008 Since you appear to have access to the whole of the C: drive (Win32) is there a specific reason why you're trying to use .htaccess files? (they're not recommended if you have access to httpd.conf) http://httpd.apache.org/docs/2.0/howto/htaccess.html#when httpd.conf - example password protection ----------- <Directory c:/wwwroot/private> Order Allow,Deny Allow from All #Disable .htaccess files in this location to help prevent hacking (esp in Win32 Apache) Allowoverride None AuthUserFile C:\Program Files\Apache Software Foundation\Apache.htpasswd AuthGroupFile /test AuthName EnterPassword AuthType Basic Require user test #Allow from local machine(s) Allow from 127.0.0.1 Alllow from 192.168.1. #Use satisfy any or satisfy all - depends on your needs Satisfy Any </Directory> Quote Link to comment https://forums.phpfreaks.com/topic/85082-solved-password-protect-folder/#findComment-434069 Share on other sites More sharing options...
phpcode Posted January 9, 2008 Author Share Posted January 9, 2008 How would I do it without htaccess files? Quote Link to comment https://forums.phpfreaks.com/topic/85082-solved-password-protect-folder/#findComment-434146 Share on other sites More sharing options...
madmax Posted January 9, 2008 Share Posted January 9, 2008 The example I gave is a non .htaccess one Quote Link to comment https://forums.phpfreaks.com/topic/85082-solved-password-protect-folder/#findComment-434597 Share on other sites More sharing options...
phpcode Posted January 10, 2008 Author Share Posted January 10, 2008 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/85082-solved-password-protect-folder/#findComment-435725 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.