# 1. KEAMANAN: Mencegah akses ke direktori folder secara terbuka
Options -Indexes

# 2. AKTIFKAN ENGINE REWRITE
RewriteEngine On

# 3. PEMBERSIHAN URL (Hapus ekstensi .php)
# Mengubah: hotel.com/kontak.php -> hotel.com/kontak
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

# 4. PROTEKSI FILE KRUSIAL
# Mencegah akses langsung ke file koneksi database dari browser
<Files "koneksi.php">
    Order Allow,Deny
    Deny from all
</Files>

# 5. KOMPRESI GZIP (Mempercepat Loading Mobile-First)
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
</IfModule>

# 6. PENANGANAN ERROR 404 (Opsional)
# ErrorDocument 404 /404.php