I just wanted to see if anyone could offer some thoughts or opinions on an issue we are having.

We are running Drupal 8 multisite via Aegir. We have a production environment and an identical testing environment set up. In our test environment we have our Drupal 8 multisite using domains such as site1-testing.com.

The issue is the file structure is set like /sites/site1-testing.com/files/. This poses an issue when we migrate to our production domain which would be site1.com. Anywhere where we inserted a link to a file would still be referencing /sites/site1-testing.com/files/filename.pdf, which would of course, cause all of our production links to break.

We use linkit as well to insert the files into nodes. I've tried using pathauto, pathologic in conjunction with url aliases but ultimately the direct paths remain the same.

Any thoughts on how we could get around this?

1 Answer 1


Site internal links should always use URIs relative to your base URL. This would avoid your specific issue. (File entities actually do use URIs relative to the configured public files folder, so that - depending on how you created your file URLs within CKEditor - clearing your caches might help already.)

However, in a mirrored multi-site environment, you can also use the sites.php file to define the base URLs and their respective target site paths. If not configured otherwise, your files folder should use the configured target sites path and all your environments will use the same files location.

Place a sites.php file in your [DRUPAL_ROOT]/sites folder (e.g. by copying and renaming the existing examples.sites.php file) and configure the $sites array keys to your requirements. Example:

$sites['site1.com'] = 'site1.com';
$sites['site1-testing.com'] = 'site1.com';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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