Home .htaccess .htaccess - how to deny access to the folder and attached files?

.htaccess – how to deny access to the folder and attached files?

Author

Date

Category

AND attached files to this folder.


Answer 1, authority 100%

.htaccess file should be placed in the folder with files to be prohibited

& lt; FilesMatch ~ "\. (php | htm | html | js) $" & gt;
 Order allow, deny
 Deny from all
& lt; / FilesMatch & gt;

Answer 2, authority 67%

One line in .htaccess

is enough

Deny from all

Put the file in the folder to be closed. Everything in the folder will be closed.


Answer 3, authority 50%

To prevent browsing site directories, add the following code to .htaccess:

Options All -Indexes

Source – Habrahabr.

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