Reputation:
In my site I've some file used by my application where are putted the log information. For example a log file is "access.log", and i write in by PHP. If a visitor go to www.mysite.ext/access.log , can see the file and all the information inside it. How can I disallow this? thanks a lot
Upvotes: 0
Views: 1016
Reputation: 536
If you want to do this in Apache, you can add the following to your .htaccess:
<files access.log>
deny from all
</files>
Upvotes: 3
Reputation: 3028
Put this in your .htaccess
<FilesMatch "\.(htaccess|htpasswd|pinc|ini|phps|fla|psd|log|sh)$">
Order Allow,Deny
Deny from all
</FilesMatch>
Will block .log
and other common files you don't want people to access.
Upvotes: 4