L
L
Lavrov952020-12-05 01:05:11
Access rights
Lavrov95, 2020-12-05 01:05:11

What are the correct permissions for folders and files for a website?

What are the correct permissions for folders and files for a website? Also I need the example.com/public/imagesreturn to be forbidden, but the images inside it should be displayed. And how to do it automatically.

public (folder)
     images (folder)
          image-1.png (file)
          image-2.png (file)
     css (folder)
          bootstrap (folder)
               bootstrap.css (file)
          custom.css (file)
     js (folder)
          bootstrap (folder)
               bootstrap.js (file)
          custom.js (file)
     assets (folder)
          ckeditor (folder)
               adapters (folder)
                    jquery.js (file)
     index.php (file)
     .htaccess (file)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2020-12-05
@ky0

To prevent the directory listing from being displayed, set the appropriate directive in the web server config, file permissions have nothing to do with it.
As for files, permissions (if it is not shared hosting, of course) are needed so that users under which your web servers and interpreters like PHP are running can do everything they need to work with files. In other words, there is no universal recipe, apart from the obvious one: do not allow anything superfluous to anyone, add such an opportunity to files that are planned to be executed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question