Most websites are open to the public, but some sites want to restrict access to certain areas. Password protection using an .htaccess file allows sites to restrict access to members, customers, or sensitive information. The .htaccess file contains directives that tell the web server to require a valid username and password stored in a separate .htpasswd encrypted file to access the protected content. Administrators can create protected folders and copy the .htaccess file to each one to use the same or different usernames and passwords for each folder.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
36 views
Unit 11
Most websites are open to the public, but some sites want to restrict access to certain areas. Password protection using an .htaccess file allows sites to restrict access to members, customers, or sensitive information. The .htaccess file contains directives that tell the web server to require a valid username and password stored in a separate .htpasswd encrypted file to access the protected content. Administrators can create protected folders and copy the .htaccess file to each one to use the same or different usernames and passwords for each folder.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Unit 11
The Web Book
1) Most websites are open to the public. 2) For example, if you run the web site for a club or a school, youll want to restrict certain areas to members or students only. Or perhaps your site contains information that has a value, such as documents or pictures, and you need to ensure that its only viewable to your paying customers. 3) Because theres a facility built into most web servers. You dont even need to do any programming. 4) The .htaccess file is used to provide special instructions to a web server. The other main use for a .htaccess file is password protection. 5) For such purposes, the file needs to look something like this: AuthType Basic AuthName "test" AuthUserFile "/home/thewebbo/.htpasswds/.htpasswd" require valid-user 6) To start password-protecting your web site, use FileZilla to create a new folder on the site, within public_html, called private. 7) A htpasswd file is merely a text file of usernames and passwords, with each pair on a separate line and with a colon between the usernames and passwords. 8) You encrypt the password in advance, thus the line becomes:open.When the user types in their password, the web server encrypts it and compares it to the version in the .htpasswd file. 9) If you want to use the same set of usernames and passwords for all of the protected folders, just put a copy of the same .htaccess file in each of the folders, which all point to the same .htpasswd file. If you want to use different usernames and passwords, then each protected folder will need its own 10) If you want to use different usernames and passwords, then each protected folder will need its own