简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM