.htaccess 301 www重定向后无法在多站点上使用网络管理员(仪表板)

.htaccess 301 www重定向后无法在多站点上使用网络管理员(仪表板),.htaccess,wordpress,.htaccess,Wordpress,我最近为我当前运行的博客multisite(Wordpress博客位于“mysite.com/home/”目录下)添加了301重定向非WWW到WWW on.htaccess,在以下3个文件中进行所有更改后,它们似乎工作正常: .HTACCESS # Redirect Non-WWW to WWW RewriteEngine on RewriteCond %{HTTP_HOST} ^mysite\.com\home RewriteRule ^(.*)$ http://www.mysite.com/

我最近为我当前运行的博客multisite(Wordpress博客位于“mysite.com/home/”目录下)添加了301重定向非WWW到WWW on.htaccess,在以下3个文件中进行所有更改后,它们似乎工作正常:

.HTACCESS

# Redirect Non-WWW to WWW
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.com\home
RewriteRule ^(.*)$ http://www.mysite.com/home/$1 [R=301,L]
# END Redirect Non-WWW to WWW

RewriteEngine On
RewriteBase /home/
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
WP-CONFIG.PHP

define('DOMAIN_CURRENT_SITE', 'mysite.com');
改为

define('DOMAIN_CURRENT_SITE', 'www.mysite.com');
update_option('siteurl','http://www.mysite.com/home');
update_option('home','http://www.mysite.com/home');
global $oswcPostTypes;
FUNCTIONS.PHP(主题)

update_option('siteurl','http://mysite.com/home');
update_option('home','http://mysite.com/home');
global $oswcPostTypes;
改为

define('DOMAIN_CURRENT_SITE', 'www.mysite.com');
update_option('siteurl','http://www.mysite.com/home');
update_option('home','http://www.mysite.com/home');
global $oswcPostTypes;

我可以像往常一样查看我的站点并登录到每个站点仪表板,但不能使用网络选项卡:我的站点>网络管理>仪表板,站点,用户。为了能够在不使用任何插件的情况下使用multisite上的network(网络)选项卡或更改数据库中的所有数据,是否还需要更改其他任何位置?

您的重定向似乎有问题:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.com\home
RewriteRule ^(.*)$ http://www.mysite.com/home/$1 [R=301,L]
%{HTTP_HOST}
是“HOST:”头请求中的内容,它只包含一个主机名(有时还包含一个端口),其中不能包含URI路径。尝试将其更改为:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^/?home/(.*)$ http://www.mysite.com/home/$1 [R=301,L]
您的值“$current\u blog->domain,$current\u site->domain”必须与/wp admin/network/admin.php第20行中的“$current\u blog->path,$current\u site->path”相同

在“域和路径”列中检查您的*_wp_blogs表


将您的域值从mysite.com更新到www.mysite.com

为什么不从www重新输入TLD?更多的讨论在这里:我做的是相反的,没有www到with-www。