Htaccess is not working

I used the following rewrite rule, but it says server error.

RewriteRule ^(.*)$  $1.php [NC]

I want to open [B]http://localhost/abc[/B] internally open [B]http://localhost/abc.php[/B]

How to do this?

RewriteEngine on
RewriteBase   /
RewriteRule ^(.*)$ /$1.php?&%{QUERY_STRING} [NC,L]

you can leave the “?&%{QUERY_STRING}” away if you don’t wan’t to send via get method