RewriteEngine On

# Hide .php extension
# If the request is not for a directory
RewriteCond %{REQUEST_FILENAME} !-d
# And the request + .php is a file
RewriteCond %{REQUEST_FILENAME}.php -f
# Rewrite to the .php file
RewriteRule ^(.*)$ $1.php [L]
