I am trying to block access to all .php
files in all my directories, but I need to keep one single file available so it can process user requests, but my RewriteRule is not working. How to make it to work?
Here is my .htaccess :
AddDefaultCharset utf-8
Options -MultiViews
Options +FollowSymLinks
Options All -Indexes
Order deny,allow
Deny from all
<Files ~ "\.(txt|xml|css|jpe?g|png|gif|js|pdf)$">
Allow from all
</Files>
<Files ~ "start\.php$">
Allow from all
</Files>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /start.php [QSA]
Now if I want to access for example http://localhost/test
it shows an 403 Error : You don't have permission to access /test on this server.