Tuesday, May 22, 2012

Password protection using .htaccess

Some times, some portions of website need to be password protected in order to prevent it from UN-autorized access. There are many ways to do this. One way is achieved by server side programming and other way to achieve this is client side programming like java-script. In this post I will discuss password protection using .htaccess file. This method have following steps to follow,

1. First decide what portion or directory you want to make password protected. I am considering root directory in this post.

2. After this go to this URL http://www.tools.dynamicdrive.com/password/ and generate code for your .htaccess and .htpasswd files.

3. After this you need to save these codes in .htaccess and .htpasswd files respectively. I you are unable to create .htaccess file, you can read this http://our-knowledge-base.blogspot.com/2012/05/how-to-create-htaccess-file-simple.html article to learn how to create this. Creating .htpasswd file is exactly same like creating .htaccess file.

4. Now upload the both file in the corresponding directory. Your website is password protected now.

feel free to post your feedback

Thanks


2 comments:

  1. To tell you the teuth I was passing around and come across your site. It is wonderful. I mean as a content and design. I added you to my list and decided to spent the rest of the weekend browsing. Well done!
    http://scarprin.com/

    ReplyDelete
  2. Thanks for the post. I had been looking for something related and found your web site in the process.. I will definitely be back for more.

    ReplyDelete

Please feel free to post your comments. If anyone has a good article or good thing to share, just send me that with your name to asadmehmoodstar@gmail.com. and if anyone want so receive updates regarding my blog, he can subscribe to my weekly newsletter on "Subscribe to our mailing list" section.

Thanks