Create your .htaccess file in the root of your website.
RewriteEngine On
# Internally rewrite extensionless page URLs to PHP files
# if no extension or trailing slash on requested URL
RewriteCond %{REQUEST_URI} !(\.¦/$)
# and if filename exists when .php is appended
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule (.+) $1.php [L]