I am constantly getting the bellow error. Can someone share if this is seen before and what I need to do to prevent it from happening or at least ideas to investigate the root cause. This is filling my logs constantly.
2011/05/23 02:26:39 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "favicon.ico".' in /framework/web/CWebApplication.php:332
Stack trace:
#0 /framework/web/CWebApplication.php(121): CWebApplication->runController('favicon.ico')
#1 /framework/base/CApplication.php(155): CWebApplication->processRequest()
#2 domainname.com/index.php(18): CApplication->run()
#3 {main} REQUEST_URI=/favicon.ico
Thanks for your replies. I know what favicon is I just don’t understand how come none of my other yii websites have this and its just my latest project that is picking these up so I was wondering if I’ve done smth wrong.
I think I will just create the file. If complications occure I will seek help again. Thanks again for your feedback
The favicon and robots errors were annoying me to death, especially in the runtime/application.log file. Also these requests register false site access if I’m logging the visits.
I’ve found a very simple and effective cure. Anyway I declared the Controller’s init() method, so I’ve put a small code here.
In protected/components/controller.php:
...
public function init() {
// filter out garbage requests
$uri = Yii::app()->request->requestUri;
if (strpos($uri, 'favicon') || strpos($uri, 'robots'))
Yii::app()->end();
// do the other initialization stuff
...
}
...
Be careful, you must edit the above code if you have a controller or action named ‘favicon’ or ‘robots’.