Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

The Problem

Not having a favicon will clog up your log files with lines like these,

192.168.0.197 - - [27/Sep/2009:22:00:17 -0400] "GET /favicon.ico HTTP/1.1" 404 240 "-" "Mozilla/5.0...
192.168.0.197 - - [27/Sep/2009:22:00:20 -0400] "GET /favicon.ico HTTP/1.1" 404 240 "-" "Mozilla/5.0...
192.168.0.197 - - [28/Sep/2009:00:17:19 -0400] "GET /favicon.ico HTTP/1.1" 404 240 "-" "Mozilla/5.0...

If you do not know what is a favicon is, well here is a direct link to the Wikipedia on favicon.

Configure a 0 Byte favicon.ico

In some cases your website does not require a logo and you just want the errors to stop showing up.

0 Byte favicon.ico

In this case you can download my 0 byte favicon.ico and place it in the /var/www folder or you can create your own using the touch command,

sudo cp ~/favicon.ico /var/www/

At this point you should stop seeing the 404 error entries in both your main host and your virtual host, but the favicon logo (if you chose to use one) will not show up on the browsers yet.

Enable ico Files in Page

favicon is specified at the web page level.

To activate your favicon, you must modify the source of your web page. Add this line to the <head> section of your page:

<link rel="shortcut icon" href="/favicon.ico">

For example,

<html>
<head>
    <title>This is the title of my page!</title>
    <link rel="shortcut icon" href="/favicon.ico">
</head>
<body>
    Hello world!
</body>
</html>
  • No labels