Lunarpages Web Hosting Forum

Author Topic: Favicons  (Read 2382 times)

Offline tech4all

  • Spaceship Captain
  • *****
  • Posts: 124
Favicons
« on: May 30, 2012, 12:26:47 PM »
Trying to add a favicon to a website, but it's not working. I've tried several ways with the code and tried .png and .ico files but the most i get is a blank spot (as opposed to the default icon for a browser).

I've tried this but nothing:

Code: [Select]
<link rel="shorcut icon" href="favicon.png">

The page is a .php file, I've read favicons don't work on .php files? - I'm not a PHP expert or even a novice. I just use it for the "include" function.


Read a post by Mr. Phil: http://www.lunarforums.com/web_site_management/quicksite_how_to_add_favicon-t57845.0.html;msg370537#msg370537

Not what he means by "The <link> tag is unnecessary if . . ."

Any help is appreciated!  :help:

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6424
Re: Favicons
« Reply #1 on: May 30, 2012, 01:07:02 PM »
You don't need to add a <link> HTML tag (statement) if certain conditions are met for the favicon: name, location, and type. If it's /favicon.ico, that's where browsers look by default.

Favicons work perfectly well with PHP pages. You created the favicon with a specific TYPE -- don't go changing the file extension trying to get it to work. If you saved it as ICON format, use .ico. If you saved it as PNG format, use .png (and you will need a <link> in that case).

Finally, as I said before, if your browser has already visited this site and you change/add the favicon, many browsers won't know to ask for the favicon again and update the local (browser) copy. How to force a (re)read of the favicon varies by browser, but unbookmarking it and clearing the browser cache often works. Sometimes you need to clear the browser history too. If all that fails, the passage of time (a few days to a week) will often solve the problem.
Visit My Site

E-mail Me
-= From the ashes shall rise a sooty tern =-

Offline tech4all

  • Spaceship Captain
  • *****
  • Posts: 124
Re: Favicons
« Reply #2 on: May 30, 2012, 01:19:20 PM »
Thanks for the info Mr. Phil.

Got it working on some browsers but not all. Trying both PNG and ICO files and get different results in different browsers using both Mac and PC. But it doesn't seem to work at all with IE on Windows 7.

I'll keep playing with it.