DirectoryIndex index.html
RewriteEngine On
RewriteBase /storyapi/admin/

# --- Angular SPA routing ---
RewriteCond %{REQUEST_URI} !\.(html|css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.html [L]

# --- Cache rules ---
<FilesMatch "\.(css|js|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$">
  Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>

<FilesMatch "\.(html)$">
  Header set Cache-Control "no-store, no-cache, must-revalidate"
  Header set Pragma "no-cache"
  Header set Expires "0"
</FilesMatch>
