[php] How can I remove file extension from a website address?

Remove a file extension through .htaccess:

Original URL: http://ravinderrathore.herobo.com/contact.php

.htaccess rule to remove .php, .html, etc. file extensions from URLs:

RewriteRule ^(.*)$ $1.php

After Rewriting: http://ravinderrathore.herobo.com/contact

RewriteEngine on

RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/

RewriteRule ^index(.*)?$ index.php$1 [L,QSA]

RewriteRule ^login_success(/)?$ login_success.php [L,QSA]

RewriteRule ^contact(/)?$ contact.php [L,QSA]