dqxz96998 2017-03-27 09:46
浏览 71

多站点域映射wp-admin登录循环

I am trying to setup my multitsite with unique domains for each site. What Ive been trying: create the multisite with the specified config an .htaccess create sites (tried sub-domain & directory) test the sites work (they do) change the Site Address (URL) to the needed domain test the domain works perfect test the wp-admin dashboard this then starts the reauth login loop

if I login to the reauth link im stuck in the loop, if I change the url to wp-login then the correct cookie is created and login works until the cookie expires.

I have tried every proposed fix I have found in a whole weekend of searching: define( 'COOKIE_DOMAIN', $_SERVER[ 'HTTP_HOST' ] );, define( 'COOKIE_DOMAIN', '' ); and many many more none of them make any difference.

Only theme is 2016, no plugins etc etc

The problem is obviously cookies but I don’t know where to start, to see why.

  • 写回答

1条回答 默认 最新

  • dongwo5589 2017-04-14 21:38
    关注

    i had a similar problem. this solution worked for me on:

    • wordpress 4.7.3
    • multisite (sub directory) network
    • native domain mapping (no plugin)

    solution: add the following to the wp-config.php file

    define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
    

    right beneath the /* Multisite */ configurations

    define( 'WP_ALLOW_MULTISITE', true );
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'website.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);
    define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
    

    i found the solution here: https://gist.github.com/MikeNGarrett/e20d77ca8ba4ae62adf5

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大