htmlapacheapache2raspberry-pi

Where do I put my favicon?


I have been searching everywhere for where to put my favicon. Currently I have it in my document root(/var/www/favicon.ico)(I am using apache2 on ubuntu), and my code looks like this in my index.html (The only other file in /var/www)

<link rel="shortcut icon" href="/var/www/favicon.ico" type="image/x-icon" />

Is it supposed to go in my ServerRoot? I have tried clearing chromes cache, but every time all I get is the same freenom (My domain name provider's) favicon. When I go to my website http://www.website.cf/favicon.ico, I can see their 16*16 icon.

Sorry if I have botched some terminology, I'm a linux/apache newb. Thanks for any help!


Solution

  • Put it in your web root. This is the default location and web browsers will always look there first. Then you won't need to use a <link> tag but if you do you would use:

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

    Based on your cpode sample above that would be in your /var/www directory.