# Inbound Motions - LiteSpeed Production Configuration
RewriteEngine On

# 1. Force HTTPS safely
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# 2. Custom 404 Error Page
ErrorDocument 404 /404.html

# 3. Clean URLs (maps /thank-you to thank-you.html, /admin to admin.html, etc. without looping)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^([^/]+)$ $1.html [L]

# 4. Default Directory Index
DirectoryIndex index.html

# 5. Disable Browser Caching for Admin Dashboard to force immediate updates in Chrome
<IfModule mod_headers.c>
  <FilesMatch "admin\.html$">
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires 0
  </FilesMatch>
</IfModule>
