Dear all,

i want to make my links appears without extensions ( instead of (
i used this code and it works fine
RewriteEngine on

RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

1- but my problem is that i have a folder name contact and a file with the same name (contact.php)

when i click on the link it opens the folder not the html file

notice that my website is dynamic and i can not add static links on htaccess files.. i just want to check if there is a folder with the same name just open the original php file not the folder.

2- also for index.php page on my wampserver when i clicked on this link ( http://localhost/trial/index)
it goes to http://localhost/index/ which is an error.. i want to go to the direct link without removing /trial/