Options -MultiViews
DirectoryIndex index.php
RewriteEngine On

# Force HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]

# Internally load PHP files without .php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [END]

# cPanel PHP 8.2 handler
<IfModule mime_module>
    AddHandler application/x-httpd-ea-php82___lsphp .php .php8 .phtml
</IfModule>