As the WordPress core can only assign a single domain to a multisite blog, one must employ the very early called sunrise.php, to setup multiple domains for a single blog in a WordPress Multisite environment. One use case for such a setup is a multilingual blog with one domain per language (e.g. when using Polylang with language selection by domain).
- Create
wp-content/sunrise.phpif it does not exist - Paste the snipped below into the
sunrise.php - Configure your extra domains:
- call
cybo_add_extra_domain( $domain, $blog_id )with the additional domain and the id of the blog it should point to
- call
- you can call it multiple times for multiple domains