RewriteEngine On

# Update backups, cached release state and staged packages are never public.
RewriteRule ^storage/updates(?:/|$) - [F,L]

# Serve dynamic robots.txt and sitemap.xml directly.
RewriteRule ^robots\.txt$ robots.php [L]
RewriteRule ^sitemap\.xml$ sitemap.php [L]

# Send all other non-file/non-directory requests through StudioCMS.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

<IfModule mod_headers.c>
    Header always set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
    Header always set Pragma "no-cache"
    Header always set Expires "0"
</IfModule>

<IfModule LiteSpeed>
    CacheDisable public /
</IfModule>
