# Place this in the same folder as the built dist/ files on cPanel
# (e.g. public_html/ or public_html/menu/ if deployed to a subfolder).
RewriteEngine On
RewriteBase /

# Don't rewrite real files/assets or the API folder
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_URI} ^/api/
RewriteRule ^ - [L]

# Everything else falls back to index.html so Vue Router can handle it
RewriteRule ^ index.html [L]

# Cache hashed build assets aggressively; never cache index.html
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/html "access plus 0 seconds"
  ExpiresByType application/javascript "access plus 1 year"
  ExpiresByType text/css "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
</IfModule>
