Showing posts with label .htaccess. Show all posts
Showing posts with label .htaccess. Show all posts

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


How to create .htaccess file - Simple steps

I this simple step by step tutorial I will tell you how to create .htaccess file using a notepad editor.
Here are the steps to do this,
 
1. Open your Windows notepad editor.


2. Make sure that the word wrap function is off.


3. Select File, then select New
 

 4. You should have a screen that doesn’t contain any text.

5. Next, select Save As

6. Type the following for your file name, .htaccess

Browse your folders and select which folder you want to save the .htaccess file in, then click Save
The next step is to verify that the file was named .htaccess by the editor. You simply open the Windows file manager, locate the file, right-click the file icon and selecting Properties.) If the file was named with the .txt suffix, you can rename the file to .htaccess and your done.

Thanks