Sponsored Links


If you are working on a website and want only selected people to access it,then the best option is to password protect the site or the root directory.This could be done easily by placing two files in the directory, .htaccess and .htpasswd.

image

.htaccess file

AuthType Basic
AuthName "restricted area"
AuthUserFile /path/to/the/directory/you/are/protecting/.htpasswd
require valid-user



Place the code in a text file and name it “.htaccess” and place it in the directory you want to password protect.Also note that the AuthUserFile should have the absolute path to the directory.It will be like /home/user/public_html/website/subdirectory/.htpasswd


You should be able to to echo out a phpinfo(); on a page in that directory to scope this directory out.

.htpasswd file




username:password




“.htpasswd” file should have one username and password per line separated by a colon.Place this file in the same directory as “.htaccess” file.After placing both the files your directory or website will be password protected.



If you like this post then please Tweet this or Subscribe to the latest updates on this post through Email by CLICKING HERE.

StumpleUpon DiggIt! Del.icio.us Yahoo Furl Technorati Simpy Spurl Reddit Google Twitter FaceBook

Search below for more related articles

Loading

1 comments

  1. Anonymous // 4/18/2009 5:26 AM

    how to hack password protecting sites

Post a Comment

Please use the form below to add your own comment.Thank you.

Comment policy.


1. Comment moderation has been enabled, so if you are a spammer please leave :)
2. Don't post same comments multiple times, it will appear only after my approval.
3. I really love and appreciate comments, so feel free to express your ideas and thoughts.