RewriteEngine On

# Serve existing files/assets directly
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

# Everything else goes through the front controller
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]

# Static assets are versioned with a ?v= query string in the HTML (see
# ASSET_VERSION in index.php), so they're safe to cache aggressively without
# needing a no-store rule on PHP responses. (A previous no-store rule here
# matched index.php itself - the physical file behind every request via the
# rewrite above - which also applied it to file exports and broke CSV/Excel
# downloads in some browsers. Removed.)
<IfModule mod_headers.c>
  <FilesMatch "\.(css|js|png|jpg|jpeg|gif|svg|woff|woff2)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>
</IfModule>

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php82” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php82 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
