<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /vault/

  # --- PRIORITY 1: Security & Consistency ---
  # Force HTTPS
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  # Force non-www
  RewriteCond %{HTTP_HOST} ^www\.kinlyr\.com [NC]
  RewriteRule ^(.*)$ https://kinlyr.com/$1 [L,R=301]
  # ------------------------------------------

  # React Router (The Catch-All)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^ index.html [L]
</IfModule>

<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set X-Frame-Options "DENY"
  Header set X-XSS-Protection "1; mode=block"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 1 year"
  ExpiresByType application/javascript "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
</IfModule>