Problem with images not displaying because domain is incorrect
The first thing you need to do is stare at your Apache access logs for a while and see if you have inbound requests to the wrong URL.  You may need to configure per virtual host logfiles to see which vhost is handling which.

You may also want to disable Drupal caching (both page and block) to see if the problem persists.

My guess is that everything with your Drupal configuration is correct, but that you have inbound requests that Drupal is handling because it is the default site, and these are getting cached.

If the Apache logs indicate that Drupal is getting the wrong URL, then I would do the following:


Configure both virtual hosts to respond to the canonical URL, and the redirections.  Something like

ServerName www.example.com
ServerAlias example.com *.example.com


This will make sure the proper vhost is responding to the proper domain (which is guess is the root cause of your problem, ie you need a ServerAlias).


Configure httpd.conf or .htaccess to set up canonical URL redirection for both the Wordpress and Drupal sites.  Something like

RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com$1 [L,R=301]


These help ensure that Drupal and Wordpress only ever see requests for a single hostname.

These two things make good sense on most live sites, too.

If you still have the wrong URLs and you are 100% positive about the traffic, then my next guess would be that you have a misconfigured settings.php somewhere in your organization, and you have two sites / servers running out of the same database (eg, DEV and LIVE are actually using the same database).  To fix this, you would need to find the offending site.