Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Global favicon.ico and iOS icons

Tags:

nginx

ios

favicon

I am looking to set the icons for a domain on an nginx server I have configured. There are many different urls on this domain which will need to display the same favicon / icon no matter what the url.

I am looking for some advice in implementation.

like image 461
jeffreynolte Avatar asked Feb 28 '12 20:02

jeffreynolte


People also ask

Does Safari support PNG favicon?

Later, both Firefox and Safari added PNG support for Favicons, marking the first major change to the Favicon format.

Does favicon need to be ICO?

A favicon can actually be either a PNG, GIF, or ICO file. However, ICO files are typically used more than others as the file size is smaller and it is supported in all major browsers. PNGs are used more commonly for IOS, Android, and Windows 10 devices.

Which favicons do I need?

The optimal size for favicons is 16x16 pixels. That's how they appear in browser tabs, address bars, and bookmark lists. Ideally however, you'll create your favicon in multiple sizes. That way you'll see properly scaled versions on larger screens rather than the 16x16 version stretched out.

Are favicons still used?

Today, favicon. ico still has widespread support across a variety of browsers. However, more contemporary websites tend to use favicon.


1 Answers

If you would like to have all (sub)domains on a server have the same favicon, you can enter this in the server configuration:

location ~ /(favicon.ico|apple-touch-icon.png)$ {
    root /var/www/default;
}

And just place the icons in the above folder.

Hope that helps, cheers!

like image 135
Sabo Avatar answered Oct 19 '22 13:10

Sabo