I want to block access to \"sub/folder/index.php\", but not \"index.php\" anywhere else.
Order allow,deny
Deny from all
You can only use file names in
There are three options I can see;
-
RewriteEngine on
RewriteRule ^sub/folder/index.php$ http://yoursite/index.locked
Will give a 404 on the file, if you want a permission denied, create a read protected file at the pointed to location.