| You probably have a private website that you don't | | | | Now.htaccess is actually the default name for the |
| want to share with the world. You might also probably | | | | Apache directory where all the configuration files are |
| want people to pay a membership fee in order to be | | | | kept. The file here i.e. the.htaccess file contains |
| able to access your web page. Whatever your | | | | instructions to allow the server to behave in a certain |
| reasons may be knowing how to password protect a | | | | manner. |
| web page can be very useful and the good news is | | | | You can create a file using a htpasswd generator |
| that its not very difficult. You can password protect | | | | containing your username and password separated by |
| files, folders, and other documents and even entire | | | | a colon. Alternatively if you have SSH access to the |
| directories. You can then also set permissions allowing | | | | server. All you need to do is to SSH to connect to |
| only a selected few people to access that portion of | | | | your sever and bring up the terminal window, type cd |
| your web page. | | | | in the folder where you want to create the password |
| There are two ways in which you can go about | | | | and type: htpasswd -c.htpasswd uname. |
| password protecting your web page the first is | | | | You can also choose to password protect a folder |
| through htaccess and the other is via cgi short for | | | | using the following lines of code: AuthUserFile /fullpath |
| common gateway interface. For the sake of this | | | | .htpasswd AuthType Basic AuthName "Hide Folder" |
| discussion we are just going to look into how to | | | | Require valid-user. |
| password protect your web page using htaccess | | | | As you can see password protecting a webpage or |
| since it's the easiest and the most commonly used | | | | folder is not difficult using htaccess. |
| method of protecting a web page. | | | | |