updated to handle local caching

This commit is contained in:
2025-08-28 20:03:30 +10:00
parent 538f324ff4
commit be4fdb2f80

View File

@@ -1,3 +1,14 @@
<If "%{HTTP_HOST} =~ /(\.local|^localhost(:\d+)?$)/">
# Disable caching in dev
<IfModule mod_headers.c>
Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
Header set Pragma "no-cache"
Header set Expires "0"
Header unset ETag
</IfModule>
FileETag None
</If>
<IfModule mod_deflate.c>
# Enable on-the-fly compression for various file types.
AddOutputFilterByType DEFLATE application/javascript
@@ -54,10 +65,12 @@
# Block access to .git directory
RewriteRule .*\.git/.* - [L,R=404]
# Force HTTPS and www subdomain
<If "%{HTTP_HOST} !~ /(\.local|^localhost(:\d+)?$)/">
# Force HTTPS and www in prod
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.stemmechanics.com.au%{REQUEST_URI} [L,R=301]
</If>
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .