Place system files in a directory without public access
Example
The Documentroot is defined in /var/www/site/public_html/
Then just put the system files in any other directory that is not public. Example /var/www/site/app/
So inside that directory would be something like this
/var/www/site/app/core/
/var/www/site/app/libs/
/var/www/site/app/vendor/
In the directory /var/www/site/public_html/
, obviously you will have index.php.
In the index.php file just include the system files by doing the directory indentation.
Example: include __DIR__.'/../app/Core/Core.php';
.
Log type files, can be in another location
Instead of /var/www/site/app/logs
, suggest /var/www/site/logs/
.
One reason is that when you need to backup your folder app
, do not need to worry about skipping log files or other unnecessary.
I’m sorry, but can I go into a little more detail ? About how structured(s) these folders(s) are ?
– Edilson