# SharedGifts — Vue SPA (Apache / cPanel shared hosting)

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  # Serve existing files and directories as-is
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  # Client-side routes (/, /catalog, /p/v, /blog/..., etc.)
  RewriteRule ^ index.html [L]
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch "\.(html)$">
    Header set Cache-Control "no-cache, no-store, must-revalidate"
  </FilesMatch>
  <FilesMatch "\.(js|css|svg|png|jpg|jpeg|webp|woff2)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>
</IfModule>

<IfModule mod_mime.c>
  AddType image/svg+xml .svg
  AddType application/javascript .js
</IfModule>

# Block dev/test artifacts if accidentally uploaded
<FilesMatch "^(lok\.txt|\.env)">
  <IfModule mod_authz_core.c>
    Require all denied
  </IfModule>
</FilesMatch>
