I haven’t been able to reproduce this error.
Both network_home_url()
and home_url()
returns the current subdomain in my tests. But I’m also using apache and I can see you’re using Nginx, so there might be something there.
This is what I have in my test environment’s wp-config.php
file for the multisite. Are any of yours different?
/** Site Domain */
define('DOMAIN_CURRENT_SITE', filter_input(
INPUT_SERVER,
'HTTP_HOST', // Relative URLs for swapping across app service deployment slots
FILTER_SANITIZE_URL //Remove all characters except letters, digits and $-_.+!*'(),{}|\\^~[]`<>#%";/?:@&=.
));
define('WP_HOME', 'http' . (FORCE_SSL_LOGIN ? 's' : '') . '://' . DOMAIN_CURRENT_SITE); // Override database value
define('WP_SITEURL', WP_HOME); // Override database value
/** Multisite */
define('WP_ALLOW_MULTISITE', true); // If true, a multisite network can be created
define('MULTISITE', true); // If true, this is a multisite network
define('SUBDOMAIN_INSTALL', true); // Use subdomains for subsites
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define('NOBLOGREDIRECT', WP_HOME); // If registration is disabled, redirect visitors of a non-existent site to the homepage
}