Domain mapping only works with wp-admin, home redirects to main

Hi!
I have a major problem and an urgent one as well.
I can’t get my domain mapping working correctly. I can only get the wp-admin to work, but the front just redirects to the main blog.

This is my setup for multisite. Using the config:: just breaks everything.

/**
 * Multisite Network
 */
define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
define( 'DOMAIN_CURRENT_SITE', env('WP_MULTISITE_HOME'));
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );


Config::define('ADMIN_COOKIE_PATH', '/');
Config::define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
Config::define('COOKIEPATH', '/');
Config::define('SITECOOKIEPATH', '/');

And this is my related env.

WP_ENV='development'

WP_HOME='https://domain.com'

WP_MULTISITE_HOME='domain.com'

WP_SITEURL="${WP_HOME}/wp"

WP_DEBUG_LOG=/path/to/debug.log

What am I missing?

It is archived so not sure if it is still relevant but when I was looking into multisite I used this plugin to fix some routing issues.

It may still be relevant.

Thank you for your reply!

I’m currently using that plugin. But it does not resolve the issue, sadly. I even tried removing it, without any difference.

Can’t find anyone with the same problem…

UPDATE:

Well, the error was on my behalf. Forgot about my custom redirect script for hidden sites…