我最近在上添加了301重定向非WWW到WWW。htaccess对于我当前运行的博客multisite(Wordpress博客位于“mysite.com/home/”目录下),在对以下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\');
FUNCTIONS.PHP (OF THE MAIN THEME)
更改自
update_option(\'siteurl\',\'http://mysite.com/home\');
update_option(\'home\',\'http://mysite.com/home\');
global $oswcPostTypes;
更改为
update_option(\'siteurl\',\'http://www.mysite.com/home\');
update_option(\'home\',\'http://www.mysite.com/home\');
global $oswcPostTypes;
我可以像往常一样查看我的网站并登录到每个网站仪表板
BUT CANNOT BE ABLE TO USE the network tab: 我的网站>网络管理>仪表板、网站、用户。为了能够在不使用任何插件的情况下使用多站点上的网络选项卡或更改数据库中的所有数据,是否还需要更改其他任何地方?