# Matikan tampilan daftar isi folder (Directory Listing)
Options -Indexes

# Paksa seluruh akses menggunakan HTTPS
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

# Blokir akses publik ke file sensitif (.htaccess, .sql, .env, .log, .ini)
<FilesMatch "(\.(htaccess|htpasswd|sql|env|log|ini|bak|sh)|koneksi\.php~)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Deny from all
    </IfModule>
</FilesMatch>

# Header keamanan dasar browser
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set X-Frame-Options "SAMEORIGIN"
    Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>