- Drupal 8 Development Cookbook(Second Edition)
- Matt Glaman
- 75字
- 2025-04-04 18:20:50
Domain aliases
The sites.php file provides a way to add domain aliases. This can be useful when you use a multisite functionality and need to develop it locally. A simple example would be providing a local.alias to each site.
If you had example.com and mycompany.com as different site directories, the following mapping would allow local.example.com and local.mycompany.com to map to those directories:
<?php $sites['example.com'] = 'example.com'; $sites['local.example.com'] = 'example.com'; $sites['mycompany.com'] = 'mycompany.com'; $sites['local.mycompany.com'] = 'mycompany.com';