简体   繁体   English

使用Xampp在Symfony2中未显示Favicon

[英]Favicon not showing in Symfony2 using Xampp

I'm trying to modify the Xampp favicon and it's being impossible. 我正在尝试修改Xampp网站图标,这是不可能的。

At first I changed the xampp default favicon htdocs/favicon.ico , and It still showing the orange "X". 首先,我更改了xampp默认的图标htdocs/favicon.ico ,它仍然显示橙色的“ X”。

Then I thought it could be the configuration of my symfony project. 然后我认为这可能是我的symfony项目的配置。 So I went to myProyect/web and overwrited the symfony favicon.ico with mine. 所以我去了myProyect/web并用我的覆盖了symfony favicon.ico。 I have to clarify that before I made this, it didn't show the "SF" black favicon. 我必须澄清,在我这样做之前,它没有显示“ SF”黑色图标。

And tryed to add the fav icon line to both "base.html.twig" and "layout.html.twig": 并尝试将fav图标行添加到“ base.html.twig”和“ layout.html.twig”:

<link rel="shortcut icon" href="{{ asset('favicon.ico') }}" />

And also tryed this: 并且也尝试了这个:

<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />

The favicon file is located in-> htdocs/MyProyect/web/favicon.ico favicon文件位于-> htdocs / MyProyect / web / favicon.ico

But I have no clue why is still showing the Xampp default icon... I have erased symfony cache, and both chrome and firefox cache, and still doesn't work. 但是我不知道为什么仍然显示Xampp默认图标...我已经删除了symfony缓存,以及chrome和firefox缓存,但仍然无法正常工作。

I'll apreciate some help with this, I'm a Symfony noob and some parts of it is driving me crazy. 我会为此提供一些帮助,我是Symfony新手,并且其中某些部分使我发疯。

Thank to you all. 谢谢大家

Your favicon should be in web folder root. 您的网站图标应位于Web文件夹的根目录中。 If not loading new favicon then use query string like this. 如果不加载新的图标,则使用这样的查询字符串。

<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}?v=2" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM