I am working with a basic Yii2 template. In layouts / main.php, in the head section, I installed
<link rel="shortcut icon" href="<?php echo Yii::$app->getHomeUrl(); ?>/favicon.ico" type="image/x-icon" />
or
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
or ... (so on), but it works. My application continues to show the main template icon instead of mine, that is, in the root folder, as usual.
I know that I can publish this file to avoid this problem, but I think that there should be no need.
What am I doing wrong? And how does Yii2 display its standard icon anyway?
source share