stecog
stecog

Reputation: 2344

Deny access to folder/file with .htaccess

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

Upvotes: 0

Views: 118

Answers (1)

Croises
Croises

Reputation: 18671

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.

Upvotes: 1

Related Questions