Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does favicon.ico need to reside in that same directory of index.html?

Tags:

favicon

I am already using the standard way of adding a favicon:

<link rel="icon" type="image/gif" href="/graphics_card/favicon.gif">
<link rel="shortcut icon" href="/graphics_card/favicon.ico">

so the favicon.gif and .ico are both supposed to reside on

/graphics_card

However, I found that IE 8 (or maybe other IE) cannot show it, (update: no matter how many times I pressed CTRL-F5, or clear the browser cache), but as soon as the .ico file is present in that directory where the index.html is, then it will show.

So if it is

http://www.example.com/graphics_card/nvidia/index.html

there needs to be a favicon.ico in

/graphics_card/nvidia/

too. I ended up specifying it as

<link rel="icon" type="image/gif" href="/graphics_card/favicon.gif">
<link rel="shortcut icon" href="favicon.ico">

and just put a favicon.ico in that directory. Is this the standard way?

like image 806
nonopolarity Avatar asked Nov 08 '09 04:11

nonopolarity


People also ask

Where do I put favicon ICO in HTML?

To add a favicon to your website, either save your favicon image to the root directory of your webserver, or create a folder in the root directory called images, and save your favicon image in this folder. A common name for a favicon image is "favicon.ico".

Where are favicon ICO stored?

The favicon. ico is a small icon found in the URL address bar and on bookmarks created by web browsers. ) in the front of the Computer Hope URL.

Does favicon need to be in root?

Please note: Your favicon does not have to be placed in the root directory of your site — it just usually is. If you saved it in another location, just make sure the href attribute is accurate. So if you saved it to a subfolder named “images” then you'd type in <href="images/favicon.

What is favicon ICO in HTML?

A favicon is a graphic image (icon) associated with a particular Web page and/or Web site. Many recent user agents (such as graphical browsers and newsreaders) display them as a visual reminder of the Web site identity in the address bar or in tabs.


2 Answers

No, you can put it anywhere if you specify it in the tag. However, for IE, you need to give a fully qualified URL (i.e. not a relative url).

like image 133
i_am_jorf Avatar answered Sep 28 '22 11:09

i_am_jorf


You can put it anywhere else and use the <link> tag to refer to it. e.g.

<link rel='shortcut icon' href='/images/favicon.ico' type='image/x-icon' />

However it is good practice to put it on the domain root e.g. http://example.com/favicon.ico, because modern browsers will actually do a call to that file when loading pages to load the icon first.

like image 21
mauris Avatar answered Sep 28 '22 10:09

mauris