[Tutorial] How to Password Protect a Directory on Your Website
System Requirements
You will need the following before your attempt to password-protect anything is successful.
1. Your website must be running on an Apache web server. (Recommanded WAMP SERVER)
2. Your web host must have enabled .htaccess processing - that is, they allow you to customize your web server environment using localized configuration files called .htaccess files.
3. You must have shell access, either via telnet or Secure Shell (SSH). You should also know how to use telnet or SSH to connect to your web hosting account.
Step 1 : Create a .htaccess file
Use an ASCII text editor like Notepad to create a text file with the following contents:
Code:
AuthName Put a name like AdminCP
AuthType Basic = Leave it like this.
AuthUserFile = Where is your .htpasswd?
require valid-user = The username you choosed on .htpasswd
Your .htaccess should be like this:
Code:
AuthName "Secure Area"
AuthType Basic
AuthUserFile /path/to/your/directory/.htpasswd
require valid-user
Step 2: Save and Upload the .htaccess file in the folder you want to protect like admincp.
Step 3: Set Up the Password File, .htpasswd
Open Notepad and write the username you want and the password you want like this:
Example:
Save your file has : .htpasswd
Now upload it in the directory you put .htaccess
Now you have your directory protected with a username and password
Re: [Tutorial] How to Password Protect a Directory on Your Website
Well a .htaccess file is pretty basic. an easier way is to just put a blank index.php/html/htm or whatever :P but that's really just for folder directorys (not good protection if they know the file name), anything else is better secured by this :P
Re: [Tutorial] How to Password Protect a Directory on Your Website
Thank you for your reply :P
Re: [Tutorial] How to Password Protect a Directory on Your Website
Easy.
But nice for the beginners =)
Re: [Tutorial] How to Password Protect a Directory on Your Website
we can do this in the site cpanel..but thnx
Re: [Tutorial] How to Password Protect a Directory on Your Website
good, but this can be done easier, from the options itself, but nice ^^
Re: [Tutorial] How to Password Protect a Directory on Your Website
Thanks! I was looking for this!