I have custom MVC framework and my .htaccess file rewrites rules to send all requests via index.php which then routes the requests.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(css|js|jpg|jpeg|JPG|gif|png|PNG|ico|pdf|swf|xml|pem)$ [NC]
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
Problem is that I have some .txt files in public_html folder where index.php and .htaccess
reside. Is it possible to not allow users access .txt files? Right now If I visit www.MyURL/test.txt
I can view the txt file. But if I did www.MyURL/cont/action/param1
would work correctly.