How to set different default images in an image field per domain? I'm working on a set of similar websites (promoting products of different regions) separated by Domain Access module. I'd like to set different default image in an image field in each site. Is it possible?
Point the image to a .php file instead of a .jpg file, and then write a script to


Find the domain name (https://stackoverflow.com/a/17201254/836995)
Output the appropriate image (https://stackoverflow.com/a/1353867/836995)


Something like this should work (untested):

&lt;?php

$img_file = NULL;

switch ($_SERVER['SERVER_NAME']) {
  case "www.a.com":
    $img_file = "filename_a.jpg";
    break;
  case "www.b.com":
    $img_file = "filename_b.jpg";
    break;
  default:
    break;
}

if (!empty($img_file)) {
  header("Content-type: image/jpeg");
  readfile($img_file);
}


This is a bare minimum script. A more elaborate version here: https://stackoverflow.com/a/9453207/836995 (although you don't need the .htaccess part to do this for only one image).