cPanel Server Management
For 24×7 cPanel Server Management with Monitoring, Unlimited Tech Support, Disaster Recovery, Security updates and much more Signup today!
Password protecting a directory restricts access to certain parts of your website by requiring visitors to enter a username and a password. This password process is also referred to as a type of “authentication” process.
cPanel Password Protect Directory icon.
(cPanel >> Security >> Password Protect Directories)
You can manually create password protect by using the following steps.
Create .htpasswd file for users and passwords:
htpasswd -c /path/to/file/.htpasswd username
This command will prompt you for the password.
Edit .htaccess:
AuthName “Members Only”
AuthType Basic
AuthUserFile /path/to/file/.htpasswd
require valid-user
deny from all
You can protect more than one file by using wildcard names. On the FilesMatch line, follow one of these examples:
<FilesMatch “*.php”>
<FilesMatch “file.*”>
<FilesMatch “*.*”>
example
<FilesMatch “*.php”>
AuthName “Member Only”
AuthType Basic
AuthUserFile /home/cpanelusername/.htpasswd
require valid-user
cPanel Server Management
AssistanZ is a pioneer in offering 24×7 cPanel Server Management Service since 2004. We offer 24×7 cPanel Server Management
cPanel Server Management
cPanel Installation and Setup
cPanel Server Optimization
cPanel Server Migration
cPanel Server Security and Hardering
cPanel Server Monitoring
cPanel Server Hack Recovery
and Much more