Create .htaccess

.htaccess files (or “distributed configuration files”) provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.

Berikut langkah-langkah yang harus dilakukan…

ketik # pico .htaccess

file .htaccess berisikan:

AuthUserFile /home/username/directory/.htpassword
AuthName "Password Required"
AuthType Basic
Require valid-user

Lalu buat file .htpasswd sebagai tempat penyimpanan list user password. Seharusnya bisa dilakukan hanya dengan mengetik perintah:

# htpasswd -bc /home/username/directory/.htpassword login password

tetapi pada cPanel user harus di locate secara spesifik asal dari command htapasswd yang ingin di jalankan, maka perintahnya menjadi:

# /usr/local/apache/bin/htpasswd -bc /home/username/directory/.htpasswd login password

You may also like...