<IfModule mod_rewrite.c>
     RewriteEngine On

    # # 🔒 Force HTTPS
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # # 🚫 Remove .php extension from URLs
    # RewriteCond %{REQUEST_FILENAME} !-d
    # RewriteCond %{REQUEST_FILENAME}\.php -f
    # RewriteRule ^(.*)$ $1.php [L,QSA]


# Enable mod_rewrite
RewriteEngine On

# Internally rewrite /file to /file.php if it exists (no redirect)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ $1.php [L]




    #⚙️ Optional AJAX rewrite example
    # RewriteCond %{REQUEST_URI} ^/ajaxlogin$ [NC]
    # RewriteRule ^ajaxlogin$ ajaxlogin.php [L,QSA]
</IfModule>