How to avoid logging of 404 missing files into error_log

 

how to stop logging of 404 error?

The Simple Method to to disable logging of 404  error into Apache error_log file is:

– open .htaccess file – domain for which you want to disable logging missing files ( 404)
– put bellow code into .htaccess file:


RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ - [R=404,L]

If you want disable logging 404 on all domains copy .htaccess files with above code in /home/ directory, then type on shell command line:


chown nobody:nobody /home/.htaccess