ITeye博客

apache 关闭 favicon.ico 不存在时的error_log

xiaojiit · 2013-03-14 15:34 · Apache · Web前端 · Markdown

当网站根目录中没有 favicon.ico文件时,

Apache会记录 File does not exist: /opt/apache2/htdocs/favicon.ico的错误日志到error_log中,

通过以下方式进行解决:

 

1.在apache配置文件中添加以下配置

# Don't bother looking for favicon.ico
Redirect 404 /favicon.ico
# Don't bother sending the custom error page for favicon.ico
<Location /favicon.ico>
ErrorDocument 404 "No favicon"
</Location>

 

 2.在网站目录中添加favicon.ico,让其变的存在。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。