Menonaktifkan Daftar Direktori di Apache: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
===Di Apache Virtual Host=== | ===Di Apache Virtual Host=== | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="apacheconf"> | ||
<Directory /var/www/public_html> | <Directory /var/www/public_html> | ||
Options -Indexes | Options -Indexes | ||
| Line 11: | Line 11: | ||
===Di File .htaccess=== | ===Di File .htaccess=== | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="apacheconf"> | ||
Options -Indexes | Options -Indexes | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 11:27, 13 January 2023
Untuk menonaktifkan daftar direktori untuk direktori tertentu, tambahkan pengaturan berikut di Apache Virtual Host atau buat file .htaccess di direktori itu dengan konten di bawah ini. Options -Indexes menonaktifkan daftar file di situs web jika file indeks hilang.
Di Apache Virtual Host
<Directory /var/www/public_html>
Options -Indexes
</Directory>
Di File .htaccess
Options -Indexes
Saat menggunakan .htaccess, pastikan bahwa server Apache diaktifkan untuk menggunakan file .htaccess untuk direktori itu. Dalam banyak kasus, .htaccess dinonaktifkan secara default.
Terakhir, muat ulang layanan Apache setelah melakukan perubahan di Virtual host untuk menerapkan perubahan.