🛡️ Access Shield Pro v1.2 выпущен - Теперь с Spamhaus и Emerging Threats
🤖 AI Support Assistant 2.1 - Поддержка GPT-5 и Claude Opus 4.1, авто-подписи, улучшенная обработка ошибок.
🧮 Пересчет Цен v1.2 - Исправлены цены дополнений, улучшена безопасность, все циклы оплаты.
🔧 PowerDNS Manager v1.11 - Улучшенная безопасность логов с лучшей очисткой данных, улучшенная обработка отладочного вывода, исправления ошибок.

Disable Directory Browsing with .htaccess Печать

  • 0

Stop Apache from showing directory contents when no index file exists.

Disable Directory Browsing

Add to .htaccess:

Options -Indexes

That's it.

What This Prevents

Without this, visiting example.com/uploads/ shows:

Index of /uploads
[ICO] Name            Last modified      Size
[DIR] 2024/           2024-01-15 10:23    -
[IMG] secret.jpg      2024-01-12 09:15   2.1M
[TXT] passwords.txt   2024-01-10 14:22   1.2K

With this, visitors get:

403 Forbidden

Variations

Disable for specific directories:

<Directory /var/www/html/uploads>
    Options -Indexes
</Directory>

Custom error message:

Options -Indexes
ErrorDocument 403 "Access denied"

Hide only certain files:

IndexIgnore *.pdf *.doc *.zip

Enable for Specific Folders

If you need directory listing somewhere:

# In specific folder's .htaccess
Options +Indexes

Check Current Status

curl -I https://example.com/uploads/

Returns 403 = disabled, 200 = enabled


Помог ли вам данный ответ?

« Назад

WHOIS Information

×
Loading WHOIS information...