DirectoryIndex index.php index.html
Options -Indexes

<IfModule mod_rewrite.c>
  RewriteEngine On

  # Map extensionless API requests to the existing PHP endpoint.
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME}.php -f
  RewriteRule ^(.+?)/?$ $1.php [L,QSA]
</IfModule>