Home .htaccess How in one .htaccess file to disable access directly to several folders?

How in one .htaccess file to disable access directly to several folders?

Author

Date

Category

How to prohibit access to the folder on the site I know: just create a .htaccess file in it with such a content:

Deny From All

And if in the folder we want to protect you can not put any additional files including .htaccess and to protect from direct access at the same time it is necessary – how to be?

or if I have a lot of different folders access to which you need to close, but at the same time I am not convenient to put the .htaccess file in each folder, is it possible to create one .htaccess in which there will be banning instructions Immediately to several listed folders?


Answer 1, Authority 100%

For example:

rewriterule ^ (includes / | lib /) - [f, l, nc]

Disable access to folders includes and lib .

or so:

& lt; files ~ "\ includes" & gt;
 Order Allow, Deny
 Deny From All.
& lt; / files & gt;

You can simply redirect for folders to make 404 error:

redirect / includes / 404.html

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions