# ===========================
# HARDENING for wh4d-amp.site
# ===========================

# 1) 403 khusus untuk root "/"
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^$ - [F,L]
</IfModule>

# 2) Matikan directory listing di semua folder
#    (agar tidak muncul "Index of /")
Options -Indexes

# 3) Tetap izinkan file index standar di subfolder
<IfModule mod_dir.c>
    DirectoryIndex index.php index.html index.htm
</IfModule>

# 4) Fallback: jika sebuah folder TIDAK punya index.*, paksa 403
#    (berguna jika Options -Indexes diabaikan server)
<IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteCond %{REQUEST_FILENAME}/index\.(php|html?|xhtml?) !-f
    RewriteRule ^ - [F,L]
</IfModule>

# 5) (Opsional) Halaman 403 kustom
# ErrorDocument 403 /403.html

# 6) Handler PHP dari cPanel (biarkan apa adanya)
# php -- BEGIN cPanel-generated handler, do not edit
<IfModule mime_module>
    AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
