I have tried following code which works fine for me.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
using this, I can access the index.php by typing localhost/myProject/index
only.
My question is, How can I take out .php from URL if I write localhost/myProject/index.php
I am doing this because I have created 100 webpages in my website and they are linked together, and now I do not want to show .php in browser and do not have time to change the code( due to short deadline :( ).
I am using LAMP stack and Apache's mod_rewrite is enabled.