I'm a curious person at heart and when I see somthing I like, I'll dive in deeper to see how it was done.  In this case, I went to a local aquarium store's website to see what they offer online just to find that their site is still under construction.  The site was nice looking and I wanted to see if they built the site using pure CSS or the old way with tables... after looking at the source, I noticed an image map with a link going to "admin" - Naturally I had to see where this went.  It turns out the webmaster of Unda The Sea has no idea what .htaccess is.   If you click on the footer section of the page, you'll notice it'll bring you to the admin section of this site with NO PASSWORD!  How can anyone design a site and not even put in a password protected admin section is beyond me.  Newbies!


It's easy to password protect a certain directory on your site.  Here's what you'll need to do:

Create a file named .htaccess with the following info:

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/mysite/.htpasswd
AuthGroupFile /dev/null require valid-user

Change the path in line 3 to where your .htpasswd file lives.

Upload the .htaccess file to the directory you want to password protect.  Then log in via shell and type in the following commands:

htpasswd -c .htpasswd username

(switch out username with whatever name you want to login as)

That's it.



It's quite in here! Why not leave a response?

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.