DirectoryIndex index.php
RewriteEngine On

# casinomilyon redirect
RewriteRule ^casinomilyon$ casinomilyon.php [NC,L]

# Force HTTPS (production)
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^localhost [NC]
RewriteCond %{HTTP_HOST} !^127\.0\.0\.1 [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Remove .php extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

# Remove .html extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^([^\.]+)$ $1.html [NC,L]

# Block direct .php access (redirect to clean URL)
RewriteCond %{THE_REQUEST} \.php[\ /?].*HTTP
RewriteRule ^(.*)\.php$ /$1 [R=301,L]
