favicon.ico 不适用于 chrome、firefox。在 IE 中处理几个页面
根据这段代码,我的 webroot 文件夹中有一个 favicon.ico
<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" />
,我在标题中使用它以使其出现在所有页面上。
<?php echo $html->meta('icon', 'favicon.ico'); ?>
正在处理的网站是 -----> 这个。
可能出了什么问题? 它在 IE 上以 3 页的形式运行。在 Firefox 和 Chrome 上,它仅适用于主页,不适用于其他页面。
请让我知道我应该做什么。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该只使用
href="/favicon.ico"
。例如,如果您注意到 http://www.movend.com/developers/ 的来源,您对 favicon.ico 的引用将解析为 http://www.movend.com/developers/favicon .ico,这是一个404错误页面。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.如果您尝试了上述所有操作,但在 IE 中仍然不起作用,请检查您的 IIS 设置(如果您使用的是 Windows Server)。
确保 HTTP 标头 > “启用内容过期”设置,未设置为“立即过期”
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”