Options -Indexes

RewriteEngine On

# Redirect /page.php → /page (canonical clean URL)
RewriteCond %{THE_REQUEST} /([^.]+)\.php [NC]
RewriteRule ^ /%1 [R=301,L,NE]

# Internally serve /page as /page.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^.]+)$ $1.php [L,NC]
