我可以登录http://localhost/wp/wp-admin/ 很好,但登录http://localhost/wp/wp-admin/network/ 生成网络重定向循环(ERR\\u TOO\\u MANY\\u重定向)。该站点即使在登录时也可以正常加载。
我怎样才能找出原因?Wordpress 4.1安装到子目录“wp”中,然后转换为多站点。到目前为止,网络中只有一个站点。
update: 这似乎非常相关:https://wordpress.org/support/topic/network-site-redirect-loop-solution
解决方法是取消检查,看看是否$current_blog->path
匹配项$current_site->path
.
I have tried clearing cookies and adding this code to wp-config:
define(\'ADMIN_COOKIE_PATH\', \'/\');
define(\'COOKIE_DOMAIN\', \'\');
define(\'COOKIEPATH\', \'\');
define(\'SITECOOKIEPATH\', \'\');
My .htaccess (未从WordPress多站点设置中修改):
RewriteEngine On
RewriteBase /
RewriteRule ^index\\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wp/$2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\\.php)$ wp/$2 [L]
RewriteRule . index.php [L]
SO网友:T.Todua
问题在于:在htaccess中,不是这样:
RewriteBase /
你应该有
RewriteBase /wp/
在中
wp-config.php
, 应该有:
define( \'WP_ALLOW_MULTISITE\', true );
define(\'MULTISITE\', true);
define(\'SUBDOMAIN_INSTALL\', false); //or true, depends on your chosen way
define(\'DOMAIN_CURRENT_SITE\', \'localhost\');
define(\'PATH_CURRENT_SITE\', \'/wp/\');
define(\'SITE_ID_CURRENT_SITE\', 1);
define(\'BLOG_ID_CURRENT_SITE\', 1);
SO网友:Arshad Hussain
在wp配置中。php中,您应该通过在wp config中的数据库配置下面添加以下内容来覆盖导致问题的给定服务器变量:
if(isset($_SERVER[\'HTTP_X_FORWARDED_FOR\'])) {
$list = explode(\',\',$_SERVER[\'HTTP_X_FORWARDED_FOR\']);
$_SERVER[\'REMOTE_ADDR\'] = $list[0];
}
$_SERVER[ \'SERVER_ADDR\' ] = DOMAIN_CURRENT_SITE;
$_SERVER[ \'REMOTE_ADDR\' ] = DOMAIN_CURRENT_SITE;
$_SERVER[ \'HTTP_HOST\' ] = DOMAIN_CURRENT_SITE;
您需要设置多站点定义(“DOMAIN\\u CURRENT\\u SITE”,“www.betterplace.org”);当然,除此之外。
SO网友:Naren Rawat
define(\'MULTISITE\', true);
define(\'SUBDOMAIN_INSTALL\', false);
define(\'DOMAIN_CURRENT_SITE\', \'**https://hotgossips.in**\');
define(\'PATH_CURRENT_SITE\', \'/\');
define(\'SITE_ID_CURRENT_SITE\', 1);
define(\'BLOG_ID_CURRENT_SITE\', 1);
define( \'DISALLOW_FILE_EDIT\', false );
Just put your full address in website url whether it\'s from www or https or https://www
在寻找了一天之后,我找到了我的解决方案。这对我有用。希望它也能为你工作!!