# Apache/LiteSpeed rewrite rules. Test on a staging host before publication.
Options -MultiViews
DirectoryIndex index.html
RewriteEngine On

# Canonical protocol and hostname. Requires a working TLS certificate.
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} ^www\.us-en-gamdom\.com$ [NC]
RewriteRule ^ https://us-en-gamdom.com%{REQUEST_URI} [R=301,L,NE]

# Redirect explicit index.html requests, including nested SEO pages.
# THE_REQUEST avoids an internal DirectoryIndex rewrite loop.
RewriteCond %{THE_REQUEST} \s/+(.*/)?index\.html[\s?] [NC]
RewriteRule ^(.*)index\.html$ /$1 [R=301,L,NE]

# Clean directory URLs always end in slash.
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ /$1/ [R=301,L,NE]

# Security: prevent directory browsing.
Options -Indexes
