# FleetTruck360 website — fleettruck360.com (static Astro build in public_html). Copied in by deploy/build-release.sh website.
Options -Indexes
DirectoryIndex index.html
ErrorDocument 404 /404.html

<IfModule mod_rewrite.c>
  RewriteEngine On
  # always HTTPS, and www → the bare domain (one address for search engines)
  RewriteCond %{HTTPS} !=on [OR]
  RewriteCond %{HTTP_HOST} ^www\. [NC]
  RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR]
  RewriteCond %{HTTP_HOST} ^www\. [NC]
  RewriteRule ^ https://fleettruck360.com%{REQUEST_URI} [L,R=301]
  # the old cPanel parking page and cgi-bin are not part of the site
  RewriteRule ^parking-page\.shtml$ / [L,R=301]
</IfModule>

<IfModule mod_headers.c>
  Header always set X-Content-Type-Options "nosniff"
  Header always set Referrer-Policy "strict-origin-when-cross-origin"
  Header always set X-Frame-Options "SAMEORIGIN"
  Header always set Strict-Transport-Security "max-age=31536000"
  <FilesMatch "\.html$">
    Header set Cache-Control "no-cache, must-revalidate"
  </FilesMatch>
  # /_astro/* names carry a content hash → cache for a year; screenshots / videos / icons for a week
  <If "%{REQUEST_URI} =~ m#^/_astro/#">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </If>
  <FilesMatch "\.(webp|png|jpg|svg|mp4|ico|woff2?)$">
    Header set Cache-Control "public, max-age=604800"
  </FilesMatch>
</IfModule>

<IfModule mod_mime.c>
  AddType video/mp4 .mp4
  AddType image/webp .webp
</IfModule>
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json application/xml image/svg+xml
</IfModule>
