Directory browsing, also called directory indexing, is when a folder without an index file shows a list of its contents to visitors. This can expose files you did not mean to share, so it is usually best turned off. This guide explains how to control it in DirectAdmin.
Why this matters for security #
If someone visits a folder that has no index.html or index.php, and indexing is on, they see a listing of every file in that folder. That can reveal backups, scripts, or documents you would rather keep private. Turning indexing off shows an error instead of the list.
Controlling indexing in DirectAdmin #
- Faça login no DirectAdmin.
- Abrir Account Manager > Directory Privacy or the Indexes tool if present.
- Select the folder you want to control.
- Set indexing to off (no indexing) for privacy, or on if you deliberately want a listing.
- Salvar.
Doing it with .htaccess #
You can also control this in your .htaccess file. Adding Options -Indexes disables directory listings for that folder and everything beneath it, while Options +Indexes enables them.
Best practice #
- Keep indexing off for most folders.
- Ensure important folders have an index file as well.
- Only enable listings for folders where a public file list is intended.
Solução de problemas #
- Still seeing a file list: confirm the setting applied to the right folder and clear your cache.
- Getting a 403 error unexpectedly: the folder may need an index file.
Precisa de ajuda? #
If you are unsure which folders to protect, our support team can advise over live chat.