We are having a very strange problem. Occassionaly we are getting the following exception:
2012/07/19 16:55:13 [error]
[exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "images/loading2.gif), url(../images/loading2.gif".' in \framework\web\CWebApplication.php:281
Stack trace:
#0 \framework\web\CWebApplication.php(136): CWebApplication->runController('images/loading2...')
#1 \framework\base\CApplication.php(158): CWebApplication->processRequest()
#2 \htdocs\index.php(13): CApplication->run()
#3 {main} REQUEST_URI=/images/loading2.gif),%20url(../images/loading2.gif
The "images/loading2.gif" is defined only in a css file!
.grid-view-loading{
background-image:url('../images/loading2.gif'), url('../images/loading2.gif');
background-position:left top, left bottom;
background-repeat:no-repeat
}
For me it looks like yii parses the css files and looks for url() definitions and trims the leading ‘(’ and closing ‘)’ characters and tries to process it as a request. Why is it working like that? Is there any solution?
I think the file does not exist thus the .htaccess file redirects it to the index.php yii script. That could happen with browsers that does not support CSS3 i guess.
That works fine as long as you never have to install the app in a subdirectory of a site.
Recently I wrote an intranet for my company, and it needed to be accessed by IP during testing, so it needed to work on xxx.xxx.xxx.xxx/intranet, on my local machine (intranet.local) and eventually on the main domain. Using relative paths in the CSS meant it could work in all locations with no code changes.