How to Hide Directory Content from Web Access – Domains and DNS
How to Hide Directory Content from Web Access
Learn secure methods for hiding directory content on your web server.
Default Directory Index Files
On our servers, default files like index.html
, index.php
, etc., are served automatically. Without an index file, directory content is visible, which may expose sensitive data.
Methods to Hide Directory Content
Option 1: Add an Empty Index File
Create an empty index.html
in directories missing an index file. This method is simple but may be time-consuming for multiple sub-folders.
Option 2: Change Directory Permissions
Set directory permissions to 711
via FTP to block listing. Learn more about changing permissions.
Option 3: Use a .htaccess File
Add an .htaccess
file to disable listing or exclude specific files. This file is recursive, so its rules apply to all sub-directories.
IndexIgnore *
How to Create and Edit the .htaccess File
- In your domain's directory, create an empty
.htaccess
file. - Edit the file and add the
IndexIgnore *
rule. - Save changes, and the rule will apply to all subdirectories.
Tags: .htaccess disable listing, directory privacy, domains and DNS, hide directory content, hide files online, prevent directory listing, web security