# Opsional: File konfigurasi untuk Apache/cPanel
# Letakkan di dalam folder yppsdp/ jika mengalami masalah 404 saat refresh

# Enable serving of static files
<IfModule mod_mime.c>
  AddType application/javascript .js
  AddType text/css .css
  AddType application/json .json
  AddType image/svg+xml .svg
  AddType image/png .png
  AddType image/jpeg .jpg .jpeg
  AddType image/webp .webp
</IfModule>

# Enable Gzip compression for faster load
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json
</IfModule>

# Cache static assets
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
</IfModule>

# Fallback ke index.html untuk semua route yang tidak ditemukan (jika suatu saat pakai BrowserRouter)
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /yppsdp/
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /yppsdp/index.html [L]
</IfModule>
