简体   繁体   English

域中具有非wp站点的WordPress多站点网络

[英]WordPress multisite network with non-wp site at domain

I want to set up a multisite network using subdomains under a domain that is used for a non-wp site. 我想使用用于非wp站点的域下的子域来建立多站点网络。

so, for example, we want our domains to look like: blog1.mysite.com blog2.mysite.com but mysite.com points to our main site that is not built with WordPress and is not part of this network. 因此,例如,我们希望我们的域如下所示:blog1.mysite.com blog2.mysite.com,但mysite.com指向我们的主站点,该站点不是使用WordPress构建的,也不是该网络的一部分。

I'm not sure what to do here since the main domain, site.com in this case, typically points to the root blog on the multisite network. 我不确定该怎么做,因为在这种情况下,主要域名site.com通常指向多站点网络上的根博客。

I suspect this is common and there is a simple solution but I'm not sure where to start. 我怀疑这很普遍,并且有一个简单的解决方案,但是我不确定从哪里开始。

Update (unresolved) : 更新(未解决):
I've had a little bit of luck working on this locally but I'm still not out of the water... 我在本地进行这项工作有点运气,但我仍然没有离开水域...

my dilemma… I need to set up multisite with subdomains under a domain that is not part of the network? 我的困境...我需要在不属于网络的域下的子域中建立多站点吗? So basically, we have our main site: mainsite.com and we want to set up a network with subdomains like site1.mainsite.com and site2.mainsite.com. 因此,基本上,我们有一个主站点:mainsite.com,并且我们要建立一个包含子站点(如site1.mainsite.com和site2.mainsite.com)的网络。

mainsite.com, however is not a WordPress site and is not part of the network. mainsite.com但是不是WordPress网站,也不是网络的一部分。 so If I set the network up under multisite.mainsite.com, then new sites subdomains are created with that as the subdomain like: site1.multisite.mainsite.com 因此,如果我在multisite.mainsite.com下建立网络,则将创建新站点子域,并将其作为子域,如:site1.multisite.mainsite.com

but if I set the current site to mainsite.com, then all of the network admin links break because they point to our main non-wp site. 但是,如果我将当前站点设置为mainsite.com,则所有网络管理链接都会中断,因为它们指向我们的主要非wp网站。

So, here's what I've done, which kinda works (I'm doing everything locally with my hosts file so I won't know for sure until I get it on a dev box) ... 所以,这就是我所做的事情,这是可行的(我正在用hosts文件在本地进行所有操作,因此直到将其放在开发箱中时我才能确定)。

  • First I pointed mainsite.com to my local ip in my hosts file and set the network up under mainsite.com 首先,我将mainsite.com指向我的主机文件中的本地IP,并在mainsite.com下设置网络
  • Next I successfully created two sites. 接下来,我成功创建了两个站点。 multisite.mainsite.com and site1.mainsite.com, through the network admin panel 通过网络管理面板显示multisite.mainsite.com和site1.mainsite.com
  • Then, I changed the 'current site' in wp-config.php from mainsite.com to multisite.mainsite.com and I removed mainsite.com from my hosts file. 然后,我将wp-config.php中的“当前站点”从mainsite.com更改为multisite.mainsite.com,并从主机文件中删除了mainsite.com。
  • Now, I can go to mainsite.com and land on our primary website; 现在,我可以访问mainsite.com并登陆我们的主要网站; I can go to site1.mainsite.com and land on the wordpress site on the network; 我可以访问site1.mainsite.com并登陆网络上的wordpress网站; and I can access the network-admin-section under multisite.mainsite.com 我可以访问multisite.mainsite.com下的network-admin-section
  • The problem is, since the current site is multisite.mainsite.com, if I try to add a new site to the network, the domain will be site3.multisite.mainsite.com instead of the intended site3.mainsite.com 问题是,由于当前站点是multisite.mainsite.com,因此,如果我尝试将新站点添加到网络中,则该域将是site3.multisite.mainsite.com,而不是预期的site3.mainsite.com。

So I still haven't found the correct solution here but this might help explain my problem a little better 因此,我在这里仍未找到正确的解决方案,但这可能有助于更好地解释我的问题

Ok, I figured it out... I didn't realize previously that you can manually change the site url in the site edit screen. 好的,我知道了...以前我没有意识到您可以在站点编辑屏幕中手动更改站点URL。 Here's a write up with more details: http://georgespake.com/create-a-multisite-network-using-sub-domains-under-an-existing-domain/ 这是一篇写有更多详细信息的文章: http : //georgespake.com/create-a-multisite-network-using-sub-domains-under-an-existing-domain/

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

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