RewriteEngine On

# Redirect .php URLs to clean URLs (optional but recommended)
RewriteCond %{THE_REQUEST} \s/([^.]+)\.php [NC]
RewriteRule ^ /%1 [R=301,L]

# If the requested resource is NOT a file or directory...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite clean URLs to .php files internally
RewriteRule ^([a-zA-Z0-9_-]+)/?$ $1.php [L]
