Knowledge Base
MilesWeb / DirectAdmin, How-Tos

How to Deny Access to .htaccess File using DirectAdmin?

Approx. read time : 2 min

Watch this video for a step by step process on How to Deny Access to .htaccess File using DirectAdmin

Protecting the vital hidden files of the hosting is a must for server security. When you deny access to the .htaccess file using a control panel like DirectAdmin, the file will be safe from external interference.

To Deny Access to .htaccess File

1. Log in to DirectAdmin.

2. Open File Manager and edit the .htaccess file.

Here’s an article that explains: How to Create/Edit .htaccess File via DirectAdmin?

3. Add this code at the end of the file:

4. Click SAVE and CLOSE the file.

If you own a VPS or a dedicated server, you can protect the .htaccess/hidden files on all the sites on it. You have to edit the /home/.htaccess file and enter the code there.

Note: If you are an admin, it is still possible to edit the .htaccess file via FTP/DirectAdmin File Manager, even after you have entered the code to deny access.

Prasad Khartadkar
Prasad is a business grad specialized in Marketing. He has garnered experience as a technical content writer and a digital marketer that he brings out in his work. He likes reading classics and travel in his free time.