最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Multisite network admin login redirect

programmeradmin15浏览0评论

I have a multisite with two different domain names.

I had an issue where I could log in to www.domain1/wp-admin and the Network Admin just fine, but if I try to log in to www.domain2/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/wp-admin and www.domain2/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');
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. */
发布评论

评论列表(0)

  1. 暂无评论