大网数据广告活动
服务器运维问答

Don't log favicon.ico errors

· 52CE 我爱测

I run an apache2 server with some vhosts (50-100). A lot of these do not have favicon.ico files, cluttering the error logs with messages like [Thu Mar 21 14:07:40 2013] [error] [client 84.xx.xx.xx] File does not exist: /var/www/s…

问题原文

原帖链接 · dtech · CC BY-SA 4.0

I run an apache2 server with some vhosts (50-100). A lot of these do not have favicon.ico files, cluttering the error logs with messages like

[Thu Mar 21 14:07:40 2013] [error] [client 84.xx.xx.xx] File does not exist: /var/www/somevhost/public_html/favicon.ico

Is there a way to disable logging of these errors if the file is favicon.ico? I've read this question but the problem is that for that to work all vhost files need to be altered, which isn't very convenient.

已采纳解答

原帖链接 · bobince · CC BY-SA 3.0

I do:

Redirect gone /favicon.ico
RedirectMatch gone ^/apple-touch-icon

Apache always logs 404s as errors, even from a Redirect, and even if you handle them using an ErrorDocument. But it doesn't for 410 (gone), which seems an equally acceptable description of the situation.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-04-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。