RewriteEngine On


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME}.php -f

RewriteRule ^([^/]+)$ $1.php [L]

RewriteCond %{THE_REQUEST} \s/+(.+?)\.php[\s?] [NC]

RewriteRule ^ /%1 [R=301,L]
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
