1

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

sites/site1.example.dev
sites/site2.example.dev
sites/site3.example.dev

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:

site1.example.com
site2.example.com
site3.example.com

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?

Thanks.

2 Answers 2

1

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:

1

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 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.