log file normally contain some sensitive information about a website. it’s good to block .log file from being access by visitor. If log file is not block, hacker might use the log file content to launch attack or profile a website. If you are running apache webserver, you can easily block .log file using .htaccess
To block .log file using .htaccess, follow the steps below:-
Advertisements
- Go to your document root directory (normally it’s the folder name is ‘public_html’, ‘www’, ‘htdocs’ folder)
- Create a new .htaccess file (if you already have a .htaccess file, just edit it)
- Append the code below to your .htaccess file:-
Order allow,deny Deny from all Satisfy All - Now you can try to upload a test.log file to your document root and try to access it, you should be seeing “Forbiden Error” or messages saying you cant read the file
Related posts:
Speed Up and Save Your Website Bandwidth with GZip Compression
How to search files by content in Mac / Linux
Prestashop 1.5 - How to enable add to cart button at Home Featured Product?
Mod Security - Open source Web Application Firewall
Free Yahoo POP3 Email account - Yahoo Mail SG and HK
CentOS 7: How to setup TUI Firewall settings?
How to check Zimbra Version without ssh access?
How to add Primary and Secondary DNS server - /etc/resolve.conf - Linux
Share this with your friends:-
How to add to this line cphp????
Just ==> ??
Thanks