简体   繁体   English

WordPress多站点WWW重定向问题(仅根站点)

[英]Wordpress Multisite WWW redirect issue (Root site only)

I am running WP 3.71 Multisire within subdirectories not subdomains. 我在子目录而非子域中运行WP 3.71 Multisire。 When I type "WWW" in the URL for the main (ROOT) site for any webpage it redirects me to the home page. 当我在任何网页的主(ROOT)网站的URL中键入“ WWW”时,它会将我重定向到主页。 The other 2 sites and the pages within these two load with or without the WWW just fine. 不论是否装有WWW,其他两个站点以及其中两个页面都可以正常加载。

I did turn off all the plugins. 我确实关闭了所有插件。 Turned off (switched) the template. 关闭(切换)模板。 And the problem still exsists. 而且问题仍然存在。

I would like for the main (ROOT) website to redirect with or without the WWW like the other two, but have not been able to figure out the issue with why it doesn't work properly. 我想让主要(ROOT)网站像其他两个网站一样在有或没有WWW的情况下进行重定向,但无法弄清楚为什么它不能正常工作。 Any help would greatly be appreciated. 任何帮助将不胜感激。

WP config file is: WP配置文件为:

 define('MULTISITE', true);
 define('SUBDOMAIN_INSTALL', false);
 define('DOMAIN_CURRENT_SITE', 'mywebsitename.com');
 define('PATH_CURRENT_SITE', '/');
 define('SITE_ID_CURRENT_SITE', 1);
 define('BLOG_ID_CURRENT_SITE', 1);

htaccess file is: htaccess文件是:

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).*) $2 [L]
 RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
 RewriteRule . index.php [L] 

Maybe you have to check your webserver configuration but wordpress saves the url in the database so it can redirect at leass you make a function to it. 也许您必须检查您的Web服务器配置,但wordpress会将URL保存在数据库中,以便它可以在您对其执行功能时重定向。 This plugin could help : Wordpress MU Domain Mapping 这个插件可以帮助您: Wordpress MU域映射

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM