# cPanel / Apache — Jetlink Services (Node.js app behind proxy)
# Application startup file: app.js

<IfModule mod_rewrite.c>
  RewriteEngine On

  # Force HTTPS on the public hostname
  RewriteCond %{HTTPS} !=on
  RewriteCond %{HTTP_HOST} ^(www\.)?jetlink\.services$ [NC]
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  # Optional: apex → www (uncomment if you standardize on www)
  # RewriteCond %{HTTP_HOST} ^jetlink\.services$ [NC]
  # RewriteRule ^ https://www.jetlink.services%{REQUEST_URI} [L,R=301]
</IfModule>

# Security headers for static files served directly by Apache (Node app adds its own via Nitro)
<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set X-Frame-Options "SAMEORIGIN"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>
