# Force HTTPS (removes "Not secure" in Chrome once SSL is installed on the server).
#
# Prerequisite: A valid SSL certificate must be enabled for this domain in your
# hosting panel (Let's Encrypt, cPanel SSL, etc.). .htaccess cannot encrypt traffic by itself.
#
<IfModule mod_rewrite.c>
RewriteEngine On

# If you are behind a reverse proxy / load balancer that sets X-Forwarded-Proto,
# uncomment the next two lines and comment out the simpler HTTPS block below.
# RewriteCond %{HTTP:X-Forwarded-Proto} !https [OR]
# RewriteCond %{HTTPS} !=on

# Standard Apache (direct HTTPS termination on this server):
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# XML sitemap (dynamic list of all public pages)
RewriteRule ^sitemap\.xml$ sitemap.php [L]

# Desktop app: route /livesports, /sportsbook, etc. to index.php (real files & dirs like /m/, /assets/ unchanged)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L,QSA]
</IfModule>
