yii [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "favicon.ico".'

yii使用中,发现runtime文件夹下出现这个错误信息

解决办法:在生成的APP程序根目录下建.htaccess文件(前提是需要开启apache重写,具体如何开,查资料咯)

然后配置如下

<IfModule rewrite_module>
Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule . index.php
</IfModule>

红字体标明的即是需要添加的规则,记录一下,方便其他遇到同样问题的朋友,也方便以后自己查看。

原文地址:https://www.cnblogs.com/debmzhang/p/3329208.html