It seems everything worked but now when loading any page, in the developer’s tools in the browser I looked, the error in this request:

Request URL:http://mysite/favicon.ico !

What is favicon.ico I don’t know and why the request goes to it - too! I have no such code!

Result of the error:

Error: yii \ web \ ForbiddenHttpException: in hosts / mysite / vendor / yiisoft / yii2 / filters / AccessControl.php: 151

In the controller prescribed access parameters!

What could be the problem in access? How to solve it?

  • one
    Create an icon (or an empty file) in the root of the site with the name favicon.ico. It can even slightly reduce the load, since redirection to index.php does not work with raising the framework and processing routing and other logic, and even better to fix it in htaccess - Ninazu

1 answer 1

favicon.ico - a website or webpage icon that is displayed by the browser in the tab in front of the page title, and also as an image next to the bookmark.

You can explicitly indicate to the browser where this icon is located. To explicitly indicate the location of favicon.ico you need to enter the following line in the page code of your site inside the head section, for example:

 <link rel="icon" type="image/png" href="/someimage.png" /> 

Many modern browsers do not require explicit reference to favicon.ico in the page code. If there is no such indication, the browser tries to download favicon.ico from the site root. What, in fact, is trying to make the browser in your case.