PHP to stop Apache from logging specific 404s
Posted on 2009-05-07
[Thu May 7 13:23:47 2009] [error] [client xx.xx.xxx.x] File does not exist: /home/osbornew/live/7150.cfm
The trick is, I've got a custom 404 error handling page. It queries a database with the info /7150.cfm and serves up a valid page. If /7150.cfm is not in the database, it shows the 404 error page and gives the 404 header.
The trouble is all of these "File does not exist" messages are filling up my Apache error log. Can I disable them with PHP if it finds something in the DB? And/or, can we disable logging 404 messages altogether for Apache?