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:
- Falschgeld kaufen , counterfeit deutsch WhatsApp +4915212508422 Fake Banknoten ka
- Finding Reliable Online Music Extractors
- Falschgeld kaufen , counterfeit deutsch WhatsApp +4915212508422 Fake Banknoten ka
- BUY UNDETECTABLE GRADE A+ COUNTERFEIT BANKNOTE(https://legitcleandocs.com)passports,
- counterfeit deutsch , Falschgeld kaufen WhatsApp +4915212508422 Fake Banknoten kauf
- Falschgeld kaufen, counterfeit deutsch WhatsApp +49 176 20673974 Fake Banknoten kaufe
- Falschgeld kaufen,counterfeit deutsch , WhatsApp +4915212508422 Fake Banknoten kauf
- Registrierten reisepass online kaufen, fÜhrerschein
- WO KANN ICH FALSCHES GELD KAUFEN WhatsApp….. +48 52 553 13 3
- Buy real registered passports(https://legitglobalpapers.com)drivers license, id card,
Bookmarks