PDA

View Full Version : .htaccess/.htpasswd



terryv
06-23-2009, 05:58 PM
Hello

I am trying to password protect a folder in my domain.

I have the .htpasswd file located on the root of my domain "/.htpasswd"
I have a folder called SWCD in the public html folder - this I want password protected.
In the SWCD folder I have the .htaccess file which contains the following:


AuthUserFile /.htpasswd
AuthName "Restricted Area"
AuthType Basic
require valid-user

In the .htpasswd file, I have 1 line.

Username:Encryptedpassword

When I try to access the folder mydomain.net/SWCD, it tells me:
"A misconfiguration on the server caused a hiccup. Check the server logs, fix the problem, then try again."

Any suggestions on what the problem could be? When I get prompted for the password, I put in the "UnEncrypted" password (Which was encrypted by using an encryption program. I have tried several of them.

Thank you
Terry

Early Out
06-23-2009, 06:01 PM
To password-protect a directory, go to Control Panel, Password Protect Directories. There's no need to mess with .htaccess and .htpasswd.

terryv
06-23-2009, 06:27 PM
Thank you for the quick reply. I have right click 1000 times to edit and do other things, and never once did I notice that particular option - Thank you.

I have done this. I have password protected it but I cannot access it. When I put the username/password in when prompted, it gives me this message on a page:


Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at vanduzee.net Port 80

Any Ideas?

Thanx
Terry

MrDelish
06-23-2009, 06:32 PM
That looks like an empty page to me. Do you have any files in the password-protected folder? Once authenticated, the page should either show the home page or a directory listing of the files contained in the folder if there is no home page.

terryv
06-24-2009, 10:36 AM
Thank you for your reply.

That's exactly what it was, there was no page to display. But I did expect it to display an ftp list of files. However, I added an index.htm to the folder and voila, works like a charm.

Do you know how long a browser caches the un/pw?

Thank you so much
Terry

MrDelish
06-24-2009, 09:10 PM
I would assume that caching the password is a browser-specific setting. Admittedly, I haven't had much use for password-protected directories (I mostly use FTP accounts) so I don't know much about it.