Password Protect a Whole Site?

Status
Not open for further replies.

droobleZ

Member
Feb 3, 2008
266
1
18
Canada
Hey,

I would like to know how I can password protect a whole site.
Not just one page. I know there are scripts that can protect one page.

But what I'm looking is something that will ask for a username and password if they go to domain.com/members/ and if they enter the correct login, they will be able to access all of domain.com/members/1.htm, domain.com/members/2.htm and so on without being asked for the password.

What is the best way to do this?

Thanks!
 


make a htpasswd file, store it above your public directory and declare it as the AuthUserFile in your htaccess and add the line:
Require valid-user

If your htaccess is in the web root, the permissions should be effective for all files and subfolders as well.

If you have cPanel, you can build these files automatically with the "password protect folders" option.
 
Status
Not open for further replies.