RewriteEngine On

# If the host is my.digisoko.co.ke and someone hits HTTP, prefer HTTPS when available
# (Hosting panels often terminate SSL; leave this on if you have a cert.)
# RewriteCond %{HTTPS} off
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Existing files (assets, uploads, sw.js) served directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

# Security headers (harmless if duplicated by host)
<IfModule mod_headers.c>
  Header set X-Frame-Options "SAMEORIGIN"
  Header set X-Content-Type-Options "nosniff"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>
