I have a Drupal project that is a multi-site setup. I currently have my sites named like so:


This is fine for working locally in development, as I can point my browser to site1.example.dev, site2.example.dev, or site3.example.dev and it works. However, when I push this up to staging, I want to be able to access these sites at the following addresses:


Is it possible to simply name these as "[specific_name].example" and configure it so that I don't need to rename/update depending on the environment?


2 Answers 2


I think you may be looking into aliases.

On your sites folder there should be a example.sites.php. It basically allows aliasing sites to different names.

You could create an if and based on some environment condition (maybe the output of hostname? or a file somewhere that contains prod vs dev), enable or disable the aliases.

More documentation:


You can modify the site names for staging site in the file sites/site.php

Also update the settings.php file with the credentials of staging site.

Also need to update the site url from the host settings.

Your Answer

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

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