Newbie Spellweaver
- Joined
- Oct 5, 2008
- Messages
- 30
- Reaction score
- 0
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:
Your .htaccess should be like this:
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
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:
Code:
username:password
Example:
Code:
dave:dave
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