Here is my .htaccess file
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?r=$1 [QSA,L]
My base folder contains one "index.php" file and "app" folder and the app folder contains some php files and i don't want to direct access these php files inside app folder using browser.
As worked out in the comments to your question your requirements are actually a little more complex than what you wrote in your question.
I guess this is what you are actually looking for:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule ^(.*)$ index.php?r=$1 [QSA,L]
This will rewrite requests to index.php
when the file name in the request ends in the .php
file name extension.