Should you ever password-protect your pages? I firmly believe there are times when you should. For instance,
- When you offer a free download and you want to track how many downloads you are getting
- When you have a free offer attached to something else (ie. newsletter subscription, paid download, etc.)
- When you have a membership section of your website
- When you have privileged users who get special privileges everyone else doesn’t have
- When you want to store certain information online but you don’t want anyone else to have access to it.
There are lots of reasons you might want certain material you keep online password protected. But how do you do it?
It’s not hard. You have to create two files, an .htpasswd file and an .htaccess file. You want to keep the .htpasswd file in a separate folder from the .htaccess file. In fact, it should be above your website root, in the root folder of your server, so that hackers and bots can’t gain access to it. In that file you’ll store your password information and nothing else.
The .htaccess file will give browsers instructions on where to find your password when authorized users attempt to access the information you have for them. It will also block access to everyone else. That file will go in the folder with the information you want protected.
Those are the basics on password protection. I highly recommend protecting some of your information with passwords and not giving away everything without getting something in return.