In this tutorial, AZDIGI will show you how to protect directories on DirectAdmin by requiring access authentication.
When developing a website, there may be a need to create for visitors a directory containing resources that they can access and download. However, when accessing, visitors must have login information to be able to enter.
Or simply, if you want someone to access the http://domain.com/wp-admin path, they must go through the verification step before logging in.
This will make your folders more secure and can only be accessed by authorized people.
II. How to enable directory protection on DirectAdmin
To enable directory protection on DirectAdmin, we need to do the following 2 steps. Particularly step 3 will be for directories without the file index.html/index.php…
Step 1: Login to DirectAdmin
To login to DirectAdmin, you access the following path:
Remember to replace the
IP with your DirectAdmin server
Below is my DirectAdmin interface:
We continue to step 2 to enable the directory protection function on DirectAdmin.
Step 2: Enable directory protection on DirectAdmin
First, we access the System Info & Files feature => select File Manager to access this feature.
Next, visit the website’s source code directory. For example, I have created a directory called
and in this directory, I have prepared some files.
Go back to the website directory, right-click on this directory and select Protect.
You can set any information in the Name, User, Password section and save the User/Password information to avoid loss => click PROTECT to protect this directory.
After that, you can access the link
http://domain.com/tailieuhoctap/ to check if the directory protection feature on DirectAdmin is working. If you are asked for access information as shown below, you are successful.
However, when you log in and you get a message that you are not allowed to access, please continue to step 3.
Forbidden You don't have permission to access this resource.
Step 3: Enable displaying files in the website directory
AZDIGI has a detailed tutorial on enabling displaying files in the website directory, you can refer to the details at the following link:
I will briefly guide you as follows:
- 1. Use the File Manager to enter the directory with the protection feature.
- 2. Initialize a file named
.htaccesswith the content inside is
- 3. Save and reaccess the link.
Here is my result. all files in this directory are fully displayed after the user successfully authenticates access.
III. Disable directory protection on DirectAdmin
To disable this feature, you just need to access the
.htaccess file in this folder and delete the content circled in green below:
With just 2 steps, you can successfully protect the directory on DirectAdmin. You completely protect the wp-admin directory for your WordPress website to create an extra step in securing the website’s login.
Hope this article will be of help to you. Wishing you success!
See more useful articles about DirectAdmin at the following link:
If you need assistance, you can contact support in the ways below: