RewriteEngine On
RewriteBase /slp3/

RewriteRule ^$ dist/index.html [L]
RewriteRule ^(assets/.+)$ dist/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . dist/index.html [L]

# 避免瀏覽器快取 HTML（確保每次都載入最新版本）
<IfModule mod_headers.c>
  <FilesMatch "\.html$">
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "0"
  </FilesMatch>
  # assets 帶有 hash 檔名，可長期快取
  <FilesMatch "\.(js|css)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>
</IfModule>
