# ========================================================
# Hostinger Universal Zero-Bug Web Configuration
# ========================================================
DirectoryIndex index.php index.html
Options -Indexes

# 1. UTF-8 Encoding
AddDefaultCharset UTF-8
AddCharset UTF-8 .html .css .js .json .svg

# 2. Proper MIME Types
<IfModule mod_mime.c>
  AddType image/svg+xml .svg .svgz
  AddType image/webp .webp
  AddType font/woff2 .woff2
  AddType font/woff .woff
  AddType application/json .json
  AddType text/javascript .js
  AddType text/css .css
</IfModule>

# 3. Clean Rewrites for Hostinger
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  
  # Allow direct access to existing files & folders
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  # Route API requests to index.php
  RewriteRule ^api/(.*)$ index.php [L,QSA]
</IfModule>
