-1

My homepage is index.php and I have this in it:

<link rel="shortcut icon" href="../assets/ico/favicon.ico?v=<?php echo time() ?>" />

It is stored in /var/www/html/assets/ico/favicon.ico and is a 16x16 png file.

Despite having that and doing systemctl restart apache2 it fails to populate in my Safari or Chrome browsers.

What am I doing wrong?

Ferran Buireu
  • 28,630
  • 6
  • 39
  • 67
smcracraft
  • 493
  • 6
  • 14
  • What's the url pat that you open? I would suspect on the '..' try to use the absolute path '/assets/ico...". – Diogo Almiro Apr 11 '20 at 12:27
  • Clear your browser cache – stark Apr 11 '20 at 12:38
  • Note: the `` tag does not use and does not need a closing slash and never has in HTML. – Rob Apr 11 '20 at 14:18
  • Does this answer your question? [favicon not displayed by Firefox](https://stackoverflow.com/questions/8616016/favicon-not-displayed-by-firefox) – Rob Apr 11 '20 at 14:20
  • Okay, I changed to the absolute path for the favicon.ico and it didn't work: Also I cleared the cache using this document https://oit.colorado.edu/tutorial/clear-web-browser-cache-safari-6, but neither of the above worked. I also tried restarting the apache instance with systemctl restart apache2 – smcracraft Apr 11 '20 at 16:31
  • example.org:xx xx.yy.zz.aa - - [11/Apr/2020:09:19:10 -0700] "GET /favicon.ico HTTP/1.1" 404 488 "http://example.org/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15" – smcracraft Apr 11 '20 at 16:32
  • So that is being hit as shown in the access log for apache and is not getting favicon.ico served out. It's the old favicon.ico. It is a 16x16 .png file and has been verified to be the new one by copying the icon off-instance and viewing it. – smcracraft Apr 11 '20 at 16:36
  • So it still doesn't work. Ideas? This is the latest apache 2 on the latest linux ubuntu on aws. – smcracraft Apr 11 '20 at 16:37
  • I changed to – smcracraft Apr 11 '20 at 17:59

1 Answers1

0
  <link rel="icon"  type="image/png"  href="/assets/ico/favicon.ico?v=<?php echo time() ?>" />
smcracraft
  • 493
  • 6
  • 14
  • Please don't post only code as an answer, but also provide an explanation what your code does and how it solves the problem of the question. Answers with an explanation are usually of higher quality, and are more like to attract upvotes. – Midiparse Apr 12 '20 at 22:27