From LinuxReviews
Jump to: navigation, search

Your trendy website needs a /favicon.ico at the websites root. Most major web browsers will request /favicon.ico after looking up your domain name and you will see "GET /favicon.ico HTTP/1.1" 404 entries in your web server logs if you fail to create this file.

[edit] How to create shortcut (favicon) icon images using netpbm

  • Create a 16x16 image using Gimp or image editors.
  • Save your icon file in the PNM format. Most image tools support this format. Save your file as .jpg or .png if .pnm is unavailable.
  • Make sure you have netpbm installed.
  • Convert your pnm image to a favicon
    • ppmtowinicon -output favicon.ico yourdrawing.pnm if your image is .pnm
    • jpegtopnm yourfile.jpg | ppmtowinicon -output favicon.ico if your image is .jpg
    • pngtopnm yourfile.png | ppmtowinicon -output favicon.ico if your image is .png

Place the image in the / root of your web server

[edit] Other alternatives

The tool icoconvert is excellent for converting png images to ico files.

[edit] Add a link to the icon in the head part of your pages to make sure all browsers find it

Add a <link rel="shortcut icon" .. `` section in the ``<head> part of your page to make sure web browsers fetch it:

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

It is possible to use a full path to another location (<link rel="shortcut icon" href="http://www.mysite.net/here/favicon.ico">), but this is not recommended because common browsers look for a /favicon.ico. Generally, using alternative locations for shortcut icons only make sense if you want different icons on various parts of your site. Keep in mind that some browsers will get /favicon.ico regardless of what you ask them to get with link rel="shortcut icon".

Personal tools
hardware tests
Privacy policy
linux events


linux newz | random page | poetry | free blog