0

Okay, so I've tried every variation of the link rel code, including the -moz and - webkit ones, that I could find. No luck so far, and I've come to the conclusion that it might be my host blocking automatic client-side downloads, which is in the terms of service. So, I was wondering if I could make a PHP script that forces it to display server-side. I'm hoping for something simple like

<php>
$favicon= ("/favicon.ico");
?>

Of course that's pseudocode and there are syntax errors, but what would I actually write to do this?

user281058
  • 151
  • 2
  • 7
  • Have you tried making a `favicon.ico` in your server's document root? (Aka the folder that corresponds to the root of your website). Try clearing your browser cache. Also, php code opens with ` – DankMemes May 24 '14 at 19:16
  • How would you display something serverside? The link rel code is supposed to work, make sure you're giving the right link to the favicon img. – René Roth May 24 '14 at 19:18
  • It's in my root, but I went into the code and noticed I have like 10 of them. One for Firefox bookmarks, one for chrome bookmarks, and a bunch of different apple and android devices. All of them seem to work except the one that displays the favicon in the browser. It works just fine on my file:// copy, but not online – user281058 May 24 '14 at 19:47
  • possible duplicate of [Creating a favicon](http://stackoverflow.com/questions/1547150/creating-a-favicon) – Sergiu Paraschiv May 25 '14 at 07:37

2 Answers2

1

You either need to put your favicon.ico file in the root directory of your website, or you can use HTML to point the browser to it:

<link rel="icon" href="/foo/bar/favicon.ico"/>

edcs
  • 3,847
  • 2
  • 33
  • 56
-1

Echo this in your head section of your page

<head>
  <?php 
      echo '<link rel="icon" href="/favicon.ico" />'; 
  ?>
</head>
Krimson
  • 7,386
  • 11
  • 60
  • 97