Multisite network admin login redirect
I have a multisite with two different domain names.
I had an issue where I could log in to www.domain1.com/wp-admin and the Network Admin just fine, but if I try to log in to www.domain2.com/wp-admin, I’m getting the following error after submitting login details:
ERROR: cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.
I got around this by adding the following code to the wp-config.php:
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
However, when this code is in place I can access www.domain1.com/wp-admin and www.domain2.com/wp-admin but if I try to log in to Network Admin the login page just refreshes instead of going to the Dashboard.
This is what the multi site code in my wp-config.php looks like:
/* Multi site code */ define('MULTISITE', true); define('SUBDOMAIN_INSTALL', 'false'); define('DOMAIN_CURRENT_SITE', 'domain1.com'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] ); /* That's all, stop editing! Happy publishing. */