Gerekli olan dosya
.htpasswd dosyasıdır.Bunu oluşturmak için
Htpasswd Generator – Create htpasswd -
Htaccess Tools
Sitesini kullanabilirsiniz.
Oluşturduktan sonra bilgileri
.htpasswd dosyası oluşturup içine kopyalıyoruz.
.htacces dosyasına eklenecek kod:
PHP- Kodu
<Files admin.php>
AuthType Basic
AuthName "ACP"
AuthUserFile "path/to/passwd/file"
Require valid-user
</Files>
path to passw file kısmına .htpasswd yolunu veriyoruz.Örnek:
/home/user/public_html/.htpasswd