# ===================================================================
# MI Cokroaminoto Rejasa — .htaccess (LiteSpeed / Apache / cPanel)
# ===================================================================

# Gunakan index.php sebagai default
DirectoryIndex index.php

# Aktifkan kompresi (LiteSpeed mendukung mod_deflate)
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/json text/xml application/xml image/svg+xml
</IfModule>

# Cache aset statis
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/webp "access plus 1 month"
  ExpiresByType image/svg+xml "access plus 1 month"
  ExpiresByType text/css "access plus 1 week"
  ExpiresByType application/javascript "access plus 1 week"
</IfModule>

# Keamanan: sembunyikan file sensitif
<FilesMatch "\.(sql|md|ini|log)$">
  Require all denied
</FilesMatch>

# Blokir akses langsung ke folder config & includes
RedirectMatch 403 ^/?(config|includes)/.*$

# Header keamanan dasar
<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>

# Batas upload (sesuaikan dengan hosting Anda)
<IfModule lsapi_module>
  php_value upload_max_filesize 10M
  php_value post_max_size 12M
  php_value memory_limit 128M
  php_value max_execution_time 60
</IfModule>
