What can cause an incorrect base_url to intermittently appear for images? I have a set of images provided by a view. They are displayed on the site home page via a panels page. JCarousel is used on display. An image cache style is applied. When previewed in the view, they appear without issue.

When displayed on the home page, the path to the images uses localhost, not the server domain name, and thus are broken. All other images on the site load fine, including other images provided by image cache.

I've tried:


Clearing the cache
Flushing the image cache style


I'm not really sure what else to check. Do I have any other options beyond settings base_url in the settings.php file?
I have had a very similar issue before.

Basically, the problem I had was that the image path was saved as  url, instead of being a relative path. If this is the case, the fix is fairly simple, simply go look at that node's attributes in the database, and change the url path to a relative paths.

If you are in doubt, a quick and dirty way to see if this is really the problem:


Do a DB dump, with mysqldump or whatever you use,
grep in that file for "http://localhost" 

grep -b3 -a3 "http://localhost" yoursqlfile.sql


The b and a flag are for the number of lines returned upon a text match before and after the match it is optional and can be tweaked to higher values if wanted/needed.



Now, if there is any reference in the sql data pointing to  your http://localhost, in your node meta-data these 2 simple steps will quickly help identify where the offending nodes are.  Just note the table and field names that grep found &amp; the nid's and go change the values to relative paths using either the commandline, a script or php-myadmin!

Of course, there are many ways to do this I just pointed out a very general way of fixing your data so it is portable.

Good-luck, happy coding.