protecting my web page and folder from external using .htaccess and .htpassword in php

Posted by Testadmin on Stack Overflow See other posts from Stack Overflow or by Testadmin
Published on 2010-05-24T05:30:09Z Indexed on 2010/05/24 5:41 UTC
Read the original article Hit count: 274

Filed under:
|

Hai

I want to protect a folder (protect) and the files inside that folder. I have created a .htaccess file and put the following code.

AuthName "Myfolder" AuthType Basic AuthUserFile url/protect/.htpasswd Require valid-user

Also created a .htpassword file which contain username:password

When I run my URL http://localhost/url/protect, I got a pop up asking username and password, I entered username as username and password as password. After that I got an error page "server error 500" "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster."

Why this happened?. Any thing wrong here? Anything needs to see my pages under the folder. Please give me the answer.

© Stack Overflow or respective owner

Related posts about php

Related posts about .htaccess