Howto password protect directory in cpanel based hosting

How to add password protection to a folder inside my blog?

That question came from a hostingformula.net reader and I try to answer it with example.

I use cpanel based hosting where facility for password protect directory provided under ‘Security’ section.

Target :

I’ll create new folder called ‘magic‘ that protected by username and password.

Open cpanel and find security area, find password protected directory and clic the icon.

Pick a directory to open. I choose hostingformula.net

click Go.

Menu will provide list of folder that available to choose.

I choose ‘public_html

Beware

1. Make sure folder that you want to protect exist ( I’ve create a folder named ‘magic’ inside public_html)

2. You already browse to ‘magic’  directory.

If you still in public_html (see the address of your cpanel) just add :

/magic

as you see from the picture below.

Now you can check ‘password protect this directory’ check box.

Enter name (you can enter anything, I enter same name as folder I’ve create before) and click save.

Set permissions for /home/hosting/public_html/magic

message will appear.

Create user that allowed to access ‘magic’ folder . Click ‘Add/modify authorized user’ button when you’re done.

Finish.

You can repeat the process to add other user. I’ve create other user and pass for you if you want to try the effect.

User : testing

Password : testing123456

Address :

http://hostingformula.net/magic

See you in next post!