Restricting Access to Log Files on Hosting
Our log file has a certain
problem. The fact is that it
is directly accessible via a browser
if you access it via the correct path.
In our case, it is: /logs/errors.log.
Thus, by guessing the path to the file, a hacker can read the log with our errors. This should not be allowed.
To solve the problem, place a .htaccess file
into the logs folder
with the following content:
Deny from all
Check that the log file is accessible via a browser.
Restrict access to the log file. Make sure it is closed.