As in one.htaccess file deny access to multiple folders at once?

I know how to prevent access to a folder on the site: just create a file in it .htaccess with the following content:

deny from all

And if you can't put any additional files in the folder that we want to protect, including . htaccess and you need to protect it from direct access-what should you do?

Or if I have many different folders that need to be closed, but it is not convenient for me to put a file in each folder .htaccess, is there a possibility create a single .htaccess that will have instructions to ban multiple folders listed at once?

Author: Enshtein, 2015-11-20

1 answers

For example so:

RewriteRule ^(includes/|lib/) - [F,L,NC]

Disables access to the includes and lib folders.

Or so:

<Files ~ "\includes">
  Order Allow,Deny
  Deny from all
</Files>

You can simply redirect the folders to make a 404 error:

Redirect /includes/ 404.html
 2
Author: Suvitruf - Andrei Apanasik, 2015-11-20 09:26:52