0
votes

i have this situation:

folderA/sub/sub/..../file.xml
folderB
folderC
...
.htaccess
index.php

I need deny access to all folderA, subdirectory and files, i put this rule to .htaccess but i can only deny access to folder, not the files inside

RewriteRule ^folderA(/|$) - [L,NC]

Thanks

1

1 Answers

1
votes

You can use:

RewriteRule ^folderA(/|$) - [F,NC]

Using the [F] flag causes the server to return a 403 Forbidden status code to the client. While the same behavior can be accomplished using the Deny directive, this allows more flexibility in assigning a Forbidden status.