DirectorySlash Off
Options -MultiViews

<IfModule mod_rewrite.c>
RewriteEngine On

# =====================================================
# AFFILIATE REDIRECTS (/go/)
# =====================================================
RewriteRule ^go/betory-casino/?$ https://betorytrackers.com/d3t3dpdhy [R=301,L]
RewriteRule ^go/tiptop-casino/?$ https://tip-topplay.com/j6stgwxoi [R=301,L]
RewriteRule ^go/instasino-casino/?$ https://inslinktraff.com/ofpvlyadg [R=301,L]
RewriteRule ^go/kokobet-casino/?$ https://kokotracking.com/dkcff8kfi [R=301,L]
RewriteRule ^go/wildrobin-casino/?$ https://wbr.lynmonkel.com/?mid=342716_1977378 [R=301,L]
RewriteRule ^go/gxbet-casino/?$ https://gxbetlink.com/ocbodej9e [R=301,L]
RewriteRule ^go/binobet-casino/?$ https://trackingbino.bet/dt5bemjmf [R=301,L]
RewriteRule ^go/funbet-casino/?$ https://fnbt.lynmonkel.com/?mid=342716_1977385 [R=301,L]
RewriteRule ^go/megabet-casino/?$ https://megaa.xyz/dffpackkm [R=301,L]
RewriteRule ^go/betspino-casino/?$ https://trackingbetspino.com/duoi5ilm8 [R=301,L]

# =====================================================
# EXCLUDE INTERNAL DIRECTORIES
# =====================================================
RewriteRule ^(assets|partials|img)/ - [L]

# =====================================================
# index.html -> /
# =====================================================
RewriteCond %{THE_REQUEST} \s/+index\.html[\s\?] [NC]
RewriteRule ^index\.html$ / [R=301,L]

# /dir/index.html -> /dir
RewriteCond %{THE_REQUEST} \s/+(.+?)/index\.html[\s\?] [NC]
RewriteRule ^(.+?)/index\.html$ /$1 [R=301,L]

# =====================================================
# .html -> clean URL
# =====================================================
RewriteCond %{THE_REQUEST} \s/+(.+?)\.html[\s\?] [NC]
RewriteRule ^(.+?)\.html$ /$1 [R=301,L]

# =====================================================
# Remove trailing slash (except real dirs)
# =====================================================
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [R=301,L]

# =====================================================
# Clean URL -> .html (internal rewrite)
# =====================================================
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L]

</IfModule>
