There is a site that consists of two folders:

  • public
  • app (kernel / components / configs)

In the public folder is index.php (which connects the router) + .htaccess :

 Options -Multiviews RewriteEngine On RewriteBase /public RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ index.php?uri=$1 [QSA,L] 

In app - .htaccess

 Options -Indexes 

It is necessary to make all requests forwarded to the public .

How is it more correct and safer to configure the site, and is there any difference to configure in the configs of the site or through .htaccess ?

  • one
    You need to make public root directory, then all requests will be processed through .htaccess in it, and the app folder will not be visible from the outside, which will increase security. - Visman

0