RewriteEngine On

# Check if the requested URL is NOT an existing directory
RewriteCond %{REQUEST_FILENAME} !-d

# Check if the requested URL is NOT an existing file
RewriteCond %{REQUEST_FILENAME} !-f

# Check if the requested URL with .php appended DOES exist as a file
RewriteCond %{REQUEST_FILENAME}.php -f

# Internally rewrite the request to add .php (hidden from the user)
RewriteRule ^(.*)$ $1.php [L]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php83” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php83 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
