Forum Moderators: open

Message Too Old, No Replies

Favicon issue

         

Zaphod Beeblebrox

1:10 pm on Sep 8, 2003 (gmt 0)

10+ Year Member



I had a favicon on one of my sites, only I renamed if because I host more than one.

So, say the site was called 'mydomain1'. In my www-root I have a dir called 'mydomain1' where the actual content is located. There are also dirs called 'mydomain2' and 'mydomain3', and so on.

So, to implement a favicon I created one called 'mydomain1.ico', put it in the root, referred to it from the main page (mydomain1/index.asp), and all was well.

Until a couple of days ago, of course. No more favicon.

Also, I noticed GET requests for '/favicon.ico' right after a new visitor views a page on the site.

If anyone can tell me what brought this about I'd be most thankful!

skipfactor

1:22 pm on Sep 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I quit using them because they come & go. For instance, my Webmaster World bookmarks aren't showing the favicon right now, but they might make an appearance tomorrow.

jdMorgan

1:53 pm on Sep 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Zaphod,

IE has a problem, because it stores favicons in the Temporary Internet Files. If you clear your Temporary Internet Files, the favicons disappear. It's simply a bad implementation.

Netscape doesn't have this problem, but it does issue a request for the default favicon.ico, even if it later finds the <link rel="icon" type="image/ico" href="images/xyz.ico"> code in the page head. I use a workaround like this in .htaccess on Apache server:


# Rewrite requests for favicon.ico (Netscape fix)
RewriteRule favicon\.ico$ /images/favicon1.ico [L]

There's not much you can do about IE, except hope that they fix it eventually. For Netscape, you can set up a redirect based on your subdirectories to serve favicon1 for requests for favicon.ico in mydomain1, favicon2 for favicon.ico requests in mydomain2, etc.

Jim

Zaphod Beeblebrox

11:41 am on Sep 9, 2003 (gmt 0)

10+ Year Member



Thanks for the response, jd, but you sort of missed the point.

First, I do use the <link rel="SHORTCUT ICON" HREF="/mydomain1.ico"> tag, but there are no GET's logged concerning the icon file mentioned there, only the default icon-name "favicon.ico".

Second, since I use ASP I can't very well use RewriteRule...

mattglet

1:01 pm on Sep 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i may be wrong, but don't you have to use favicon.ico as your filename, and nothing else? (unless you write a rule like jdmorgan stated)

-Matt

jdMorgan

4:15 pm on Sep 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Matt,

No, you can name your favicon anything you want, as long as you have the two meta-tags, one for IE and one for Netscape, Opera, Mozzilla, and the rest. However, as stated above, Netscape has a bug where it will still occasionally ask for favicon.ico, even if it has already read the meta-tags.

Zaphod,

In order to support all browsers that recoginze favicons, here are the tags:


<link rel="shortcut icon" href="images/favicon1.ico">
<link rel="icon" type="image/ico" href="images/favicon1.ico">

In addition to that, you might want to check your cache-control headers to make sure the old page has expired and has been replaced by the new in all network caches.

Jim

HarryM

4:28 pm on Sep 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I was reading this thread because it's a subject that interests me, when I saw jdMorgan's post giving the two meta tags. I only have one on my web pages - I didn't realize they were browser specific.

Well, you live and learn. Many thanks.

Harry

claus

4:38 pm on Sep 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



uhm..i think i recall something about a strange (IE?) bug here, please don't hold it against me as it's been ages since i investigated and i haven't got a clue as to where i found out about it or if i remember it accurately (or if it's still true in recent browsers)

The thing is, either you have a root favicon (called favicon.ico) at the root of your website, or you have the favicon in a folder (called whatever). If both are found the root will be used and <link> tags doesn't make a difference... the rewrite should still work, however.

Just disregard this post if i recall this totally wrong, i don't remember anything else about it than what i just posted.

/claus

killroy

4:46 pm on Sep 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I read on a webpage that the correct mim settign for apache is image/x-icon

And using this, and giving the full url of the icon it shows in the browser.

But is this correct? Or should it really be image/ico?

I'm a bit confused, recently added the icon and it doesn't show, but that is normal I think with all the caching issues.

SN

jdMorgan

5:03 pm on Sep 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For Apache:

AddType image/x-icon .ico

I don't know if that is "correct" or according to whom, but it works for me.

If you want to see your icon in IE, you either have to create a new bookmark, or you can try the following user-friendly procedure:

In the IE address bar, click and drag the default icon (just to the left of the URL) all the way to the end of the URL, then release. Repeat up to three times.

If you use Netscape, the icon will just appear, assuming you have installed the meta-tags and the work-around cited above.

Jim

killroy

5:35 pm on Sep 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



damn, It ain't working for me :(

Got the addType, got the icon, got the link tags, what am I doing wrong? darnit.

SN

Zaphod Beeblebrox

10:00 am on Sep 10, 2003 (gmt 0)

10+ Year Member



jdMorgan - thanks for the additional info. I put the other link tag in, but it still doesn't show up. I don't use cache-control headers, so I really wouldn't know what the effect would be.

claus - I had two different icons in my root, for two different sites. They both worked until some time ago, and now they don't show up anymore. So it seems what you're referring to is not the case here...

jdMorgan

12:50 pm on Sep 10, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No-one seems to be mentioning browsers here, so I'd just like to comment that I always found it easier to get Netscape working first, and then mess with the IE quirks and bugs.

Netscape will GET your icon almost every time it hits the page. IE will only GET the icon the first time you bookmark a page, or when you do the drag-n-drop trick described above. The icon GET request is inside the bookmarking routine in IE. It's inside the icon displaying routine in Netscape.

Another issue is that the icon must be in the proprietary .ico format for IE, whereas Netscape will accept .png and others, IIRC.

As usual when working with images, it's a good idea to flush your browser cache (Temporary Internet Files) before doing any new test.

Jim