Protecting files on your website from unauthorized users can be very important. Even more important is the method by which you accomplish this task. You could use PHP to listen for login authorization information on each page, but that doesn't protect your images, documents, and other media, does it? That's why I've found the .htaccess method of protecting files and directories the most reliable. Oh, and it's easy too!
The system requires two files -- the .htaccess file and .htpasswd file.
The .htaccess Code
Code:
AuthType Basic
AuthName "restricted area"
AuthUserFile /home/davidwalsh/html/protect-me-dir/.htpasswd
require valid-user
The above code protects a directory called "protect-me-dir" at root level. The "AuthUserFile" value is always specific to your hosting configuration. If you don't know what the value should be, do a phpinfo() and find the DOCUMENT_ROOT value.
The .htpasswd Code
Code:
cssexpert:csmnmq.M8T5ho
The .htpasswd file contains the usernames and passwords of allowed users. One per line. The passwords are MD5'd for security purposes.
To generate encrypted passwords for your .htpasswd file, you can use .htaccess password generator.
Source: davidwalsh
View more threads in the same category:
- buy a Canadian(https://qualitydocky.com) passport, French passport, Italian passport,
- buy a USA passport(https://legitcleandocs.com)UK passport, Australia passport, German
- buy real and fake passports (https://legitcleandocs.com)drivers license, residence pe
- Buy real registered passports online(qualitydocky.com)drivers license, id card, resid
- Buy driver license
- buy real registered passports online at qualitydocky.com drivers license, id card,
- Buy Real Passport Online https://worldpassporte.com
- AUTO FÜHRERSCHEIN KAUFEN https://www.führerscheineinfach.de
- buy real registered passports online at qualitydocs247.com drivers license, id card,
- KAUFEN SIE EINEN FÜHRERSCHEIN DER KLASSE B https://fahrunte
Bookmarks