RewriteEngine On
RewriteRule something something.php [L]
http://example.com/something
will be handled as if it was a request for something.php
To redirect all requests that are not a physical file to the same name but with .php:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule (.*) $1.php [L]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…