let me remove php extension with htaccess, but additionally deny all the immediate access to php file. If you write www.site.com/test , your ok and www.site.com/test.php you cannot access! Thx

This is how you are able to rewrite http://www.site.com/test to http://www.site.com/test.php and deny direct php access.

RewriteEngine on

RewriteCond %{THE_REQUEST} \.php
RewriteCond %{REQUEST_FILENAME} !403.html$
RewriteRule .* /403.html [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !\.php$
RewriteRule (.*) $1.php [L,QSA]

However I believe that denying immediate access to .php is pointless and ugly.