<IfModule mod_rewrite.c>
    RewriteEngine On

    # Redirect explicit .php requests to extensionless URLs.
    RewriteCond %{THE_REQUEST} \s/+(.+)\.php[\s?] [NC]
    RewriteRule ^ %1 [R=301,L]

    # Internally rewrite extensionless URLs to their .php files.
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule ^(.+)$ $1.php [L]
</IfModule>

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