favicon.ico 不适用于 chrome、firefox。在 IE 中处理几个页面

发布于 2024-09-03 19:05:00 字数 588 浏览 8 评论 0原文

根据这段代码,我的 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小ぇ时光︴ 2024-09-10 19:05:00

您应该只使用 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.

给妤﹃绝世温柔 2024-09-10 19:05:00

如果您尝试了上述所有操作,但在 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”

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文