. htaccess - how do I prevent access to a folder and its attached files?

And files nested in this folder.

 4
Author: Саша Черных, 2011-08-18

3 answers

In the folder with the files that should be banned, you should place the file .htaccess

<FilesMatch ~ "\.(php|htm|html|js)$">
  Order allow,deny
  Deny from all
</FilesMatch>
 6
Author: Quiss, 2019-06-24 10:20:39

One line in .htaccess{[3 is enough]}

Deny from all

Put the file in the folder you want to close. Everything in the folder will be closed.

 4
Author: ilovetrancekrsk, 2017-08-22 12:30:29

To prevent the site directories from being viewed, add to .htaccess the following code:

Options All -Indexes

Source - Habrahabr.

 3
Author: Abduhafiz, 2016-04-20 05:37:08