我通常使用
###########################
# Remove trailing slash on non-directories
##
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ $1 [L,R=301]
###########################
# 301 /index.php to /
##
RewriteRule (.*)/index(\.[a-zA-Z]+)*$ $1 [L,R=301]
###########################
# 301 .php requests
##
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /[a-z0-9-]+\.php
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^([a-z0-9-]+)\.php$ $1 [R=301]
###########################
# Rewrite file -> file.php
##
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9-]+)$ $1.php [L]