Product Details |
 |
Information |
 |
Search f2s |
 |
|
|
Using .htaccess
How to password protect a webpage or directory using .htaccess.
|
Step 1:
The first thing you need to do is to create a file called .htpasswd using notepad. Notice the fullstop at the beginning.
In this file, we'll place an actual ID (test) and a password.
To increase security, the passwords in .htpasswd need to be in encrypted form.
To create your encrpyted password
click here.
Now type your user name followed by a : and your encrypted password into the .htpasswd file.
Now save the file and upload it to your website.
Step 2:
Now you need to create a file called .htaccess file in notepad which will be uploaded to the directory you want to protect.
Copy and paste the following into your file:
AuthUserFile /web/sites/133/accountname/www.subdomainname.f2s.com/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword
AuthType Basic
<Limit GET>
require user test
</Limit>
In the first row edit the path to your .htpasswd file (this will be found in your members area under the website section by clicking on the "view details" link)
note: you must include the file name (.htpasswd)
On the second from last line edit the user name..
For additional users add their names underneath each other ie:
<Limit GET>
require user test
require user john
require user pete
</Limit>
You must also add new users to your .htpasswd file including their encrypted password.
|
|