No way to show up favicon.ico - php

i have this in the head of the document:
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
I read all I could about it here, but that didn't help and that's why I'm asking again. I'm positive that it wasn't a typo - PHP file_exists finds the ico file fine, but none of the browsers show it... What could be the reason? This domain is new but after I checked the DNS records they are refreshed and are OK. I cleared local cache and deleted tmp files... You can see it live at http://mybestday.eu

Favicons are stored in a special cache. That cache lasts a long time (days to weeks) and can't be cleared by clearing the normal content cache. You could test favicons on a remote computer (like browserstack) or just wait 'till the cache expires.
Or, see the next answers for (ugly) workarounds:

You can clear your favicon by forcing your browser to re-cache it using a cache buster:
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=2" />
Every time you change the image, change the version (?v=) to an increment (3, 4, ...).
Here is a related discussion on this issue: How do I force a favicon refresh

**So far i can see it works ;)
**
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
Like bjb568 told you, clean the cache.

Related

Force favicon refresh formatting

I am having trouble fully implementing solution to question How do I force a favicon refresh?.
Current header.php is not refreshing the favicon as intended:
<link rel="shortcut icon" type="image/x-icon" href="...favicon.ico?v=2" />
<?php favicons(); ?>
I do not understand the role of the second line. I have found that adding a character to the end of the second line forces the favicon refresh (good!) but also displays a new line of text—whatever * is in below example—at the very top of the website (not good):
<link rel="shortcut icon" type="image/x-icon" href="...favicon.ico?v=2" />
<?php favicons(); ?>*
What is the role of the second line? How should it be formatted to force the favicon refresh without displaying a new line of text at the top of the website?
Thank you for your consideration, please let me know what other context I can provide.

Changing the favicon in Wordpress

I am trying to change the favicon in my wordpress blog. I am still not able to do so. I am using the Magazine Basic theme.
The website I am working on is www.quantgreeks.com. When I type, http://www.quantgreeks.com/favicon.ico, I still get the HostGator symbol.
I have tried this and none working:
http://en.forums.wordpress.com/topic/how-do-i-change-my-favicon-1
http://codex.wordpress.org/Creating_a_Favicon
http://www.wpbeginner.com/wp-tutorials/how-to-add-a-favicon-to-your-wordpress-blog/
Added this two lines to header.php:
<link rel="icon" href="http://www.quantgreeks.com/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="http://www.quantgreeks.com/favicon.ico" type="image/x-icon" />
Not of any use..
Need some guidance...
You are doing the correct steps if you followed any one from those sources.
I checked your site and I believe the favicon is the letter 'J'? See screenshot:
The issue you're having is probably from an old cache in your browser. Try clearing your browser cache and try again.

WAMP + PHP CSS Include wont update with new styles

I am stumped. I am using includes to import a style sheet. If I add a new style to the style sheet, generated pages will not display ANY of the new css. If I change an old css rule it WILL display the change. I thought it might be a cached file of some kind, but I have cleared the cache in all testing browsers and the problem persists.
At first I thought it was a WAMP issue, but the problem happens when I move it all live as well so now I am thinking I am doing something wrong with the includes....
<link rel="stylesheet" type="text/css" href="css/foundation.css">
<!-- Included Custom Overides -->
<link rel="stylesheet" type="text/css" href="css/Custon_Foundation_Overides.css">
<!-- Supersizer CSS -->
And this is simply my include...
<?php require("Includes/HEADER.php"); ?>
Again, all the old CSS works fine, just any new additions to any of the style sheets will not display.
Thanks
<link rel="stylesheet" type="text/css" href="css/Custon_Foundation_Overides.css">
Maybe "Custon_Foundation_Overides.css" is a typo and you meant "Custom_Foundation_Overrides.css" or maybe you have to upload the file with correct letters capitalization.
Sounds like a browser cache issue. A simple way to fix this while maintaining good caching practices would be to pass the file make time as a query var to the file.
<link rel="stylesheet" type="text/css" href="css/foundation.css?ver=<?php echo filemtime('css/foundation.css');?>">
This will generate a string like:
<link rel="stylesheet" type="text/css" href="css/foundation.css?ver=1382564850">
This way when you update the file your browser will think its a new file and cache that, but as long as the file remains unchanged it will have the same name and maintain the browser cache.

Facebook coding techniques

In an attempt to learn a little bit about Facebook and their coding techniques, I've viewed their source code. Here is one thing that I found:
<link rel="stylesheet" href="https://fbstatic-a.akamaihd.net/rsrc.php/v2/yN/r/JUrfX0ucXVq.css" />
<link rel="stylesheet" href="https://fbstatic-a.akamaihd.net/rsrc.php/v2/y2/r/gpxPzqCou0g.css" />
<link rel="stylesheet" href="https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/OWwnO_yMqhK.css" />
My question is about how Facebook composes their directory structure & filenames. Obviously the css files weren't named for readability. Is there a reason behind these random filenames? Could someone provide any information about this? Thanks in advance.
The CSS files are given random filenames to prevent browsers from caching them.
When a browser caches a resource, it will download the file and keep it on the user's computer to prevent the same file from being downloaded multiple times. The problem is that if you change your CSS file and keep the filename the same, a browser will keep using the cached version of the file and won't download the updated version. By giving the CSS files unique names, browsers are forced to download them.
It's similar to doing this with your CSS files:
<link rel="stylesheet" href="style-v1.css" />
<link rel="stylesheet" href="style-v2.css" />
<link rel="stylesheet" href="style-v3.css" />
...

favicon.ico not working on chrome, firefox. working on a few pages in IE

i have a favicon.ico in my webroot folder according to this piece of code
<link rel="icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" />
and i use this in my header to make it appear on all the pages.
<?php echo $html->meta('icon', 'favicon.ico'); ?>
The site am working on is -----> this.
What can possibly be wrong ?
It works in 3 pages on IE. On firefox and chrome, it works only for homepage, not others.
Please let me know what i should do.
You ought to just use href="/favicon.ico". If you notice the source of http://www.movend.com/developers/, for example, your reference to favicon.ico resolves to http://www.movend.com/developers/favicon.ico, which is a 404 error page.
If you tried everything above and it still doesn’t work in IE, check your IIS settings if you are using a Windows Server.
Make sure that the HTTP Headers > “Enable content expiration” setting, IS NOT SET to “Expire immediately”

Categories