Password protecting a directory on cPanel

Password defending a directory limits access to secure sections of your website by ordering visitors to enter a username and a password. This password method is also pointed to as a type of “authentication” method.
cPanel Password Protect Directory image.

(cPanel >> Security >> Password Protect Directories)

You can manually generate password security by using the next steps.
Create a .htpasswd file for users and passwords:
htpasswd -c /path/to/file/.htpasswd username
This post 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 preserve more than one file by applying wildcard names. On the FilesMatch line, support one of these cases:

example


AuthName “Member Only”
AuthType Basic
AuthUserFile /home/cpanelusername/.htpasswd
require valid-user

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Stats and Monitoring Process tool

Mysqlmymonlite Stats and Monitoring process free tool, Bash shell script tool used to gather...

cPanel Game Server Installation

cPGS is a software module that allows you to set up and run a game server. You are even able to...

Attracta SEO Tools Installation

Attracta SEO tool will verify that your website has not been flagged by Google as containing...

Server load alerts shell script

Simple Server load alerts shell script to monitor your server load average, Free Memory and Swap...

Powered by WHMCompleteSolution