I have a multisite configuration with Drupal7, my prod site is mysite.example.mydomain.com and dev is mysitedev.example.mydomain.com I have set in sites/sites.php :

$sites = array('mysite.example.mydomain.com' => 'mysitedev.example.mydomain.com', ); so searching for sites/mysite.example.mydomain.com would result as sites/mysite.dev. example mydomain.com, but I have a background Image Url:

background: url("/sites/mysite.example.mydomain.com/files/myimage.jpg");

if the Url is /sites/mysitedev.example.mydomain.com/files it works, otherwise with /sites/mysite.example.mydomain.com/files it don't! What am I missing???


  • Look at your directory structure in sites/. If your production site is in folder "default" then you would put: 'mysite.example.mydomain.com' => 'default' – Beebee May 16 '16 at 11:09

It sounds like you're confusing hostnames with file system paths.

The array mapping in sites.php is:

Hostname => Instance Folder

So taking your example, requests for http://mysite.example.mydomain.com will use the folder /sites/mysitedev.example.mydomain.com.

In that scenario, the path /sites/mysite.example.mydomain.com/files doesn't exist, so requests for files under it will return a 404. That's to be expected.

You can always add an alias/redirect via your server config, but it might be best to just use the system as it was intended.

  • Ok, thanks, but in this way i should change every url in css files? or make a symlink from /sites/mysitedev.example.mydomain.com to /sites/mysite.example.mydomain.com? – backit May 16 '16 at 12:14
  • In an ideal world your CSS should never depend on files inside the files folder. A theme needs to be able to stand on its own, and not rely on content that may or may not have been uploaded – Clive May 16 '16 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.