简体   繁体   English

Wordpress-多站点网络和域映射插件问题

[英]Wordpress - Multisite network and domain mapping plugin questions

I'm completely open to suggestions with this: 我完全愿意接受这样的建议:

I've created a cms on the wordpress platform with the use of various plugins and my own tweaks that we plan to roll out to several of our customers on different domains for different purposes. 我已经在wordpress平台上使用各种插件和自己的调整功能创建了一个cms,我们计划针对不同目的将其推广到不同域中的一些客户。

I want to run all these different wordpress sites off my cms so if I update the plugins/wordpress on one it will update across the board. 我想在我的cms上运行所有这些不同的wordpress网站,因此,如果我在其中更新插件/ wordpress,它将全面更新。 This is to ensure we're not running several sites with several different versions of plugins or indeed a different version of wordpress. 这是为了确保我们不会运行带有多个不同版本的插件或不同版本的wordpress的多个站点。

How can I go about setting this up? 我该如何进行设置? Obviously each client will have different needs (in terms of plugins) so how can I manage this? 显然,每个客户端(在插件方面)都有不同的需求,那么我该如何管理呢?

Please bare in mind that I'm not great at databases etc so go easy on me! 请记住,我不擅长数据库等,所以请放轻松!


UPDATE: 更新:

It seems like the Wordpress multi site with the domain plugin is the way to go so a few questions in regards to that: 似乎带有域插件的Wordpress多站点是一种解决之道,因此有以下几个问题:

  1. Using the wordpress network along with the Wordpress MU domain mapping plugin, what impact would this have on seo for each site? 使用wordpress网络和Wordpress MU域映射插件,这将对每个站点的seo产生什么影响?

  2. I'm guessing there would be one central place to upgrade both wordpress and the plugins across all the domains? 我猜是否会有一个中心位置来升级所有域中的wordpress和插件? Would this still allow me to choose different settings for each domain on the plugins? 这是否仍允许我为插件上的每个域选择不同的设置? Ie using the advanced custom fields plugin, would I be able to create a set of custom fields for one domain and a completely different set of custom fields for another domain. 即使用高级自定义字段插件,我将能够为一个域创建一组自定义字段,为另一个域创建一组完全不同的自定义字段。 So settings on the plugins are not across the whole network? 因此,插件上的设置是否无法覆盖整个网络?

  3. Would I still be able to adjust templates per domain? 我仍然可以按域调整模板吗?

Three words: Create a Network - http://codex.wordpress.org/Create_A_Network 三个字:创建网络-http : //codex.wordpress.org/Create_A_Network

4/14/11 edits: There's no SEO impact. 2011年4月14日修改:没有SEO的影响。 All sites are transparent to search bots. 所有网站对搜索机器人都是透明的。 All plugins and templates can be configured for each domain. 可以为每个域配置所有插件和模板。

There are all kinds of docs and help available; 有各种各样的文档和帮助。 see http://wordpress.org/support/forum/multisite and http://wordpress.org/extend/plugins/search.php?q=multisite&sort= 请参阅http://wordpress.org/support/forum/multisitehttp://wordpress.org/extend/plugins/search.php?q=multisite&sort=

One option would be a symlink to each of the plugins that you want to keep consistent. 一种选择是与要保持一致的每个插件建立符号链接。 The biggest problem that you'll have here is that you will still need to update the database for each WordPress site individually. 您在这里遇到的最大问题是,您仍然需要分别为每个WordPress网站更新数据库。 If you are only doing this for custom plugins that you've created this probably isn't a big deal because you'll know if a database update is needed. 如果仅对已创建的自定义插件执行此操作,那么这可能没什么大不了的,因为您会知道是否需要数据库更新。

ln -s <actual plugin folder> <plugins folder where you want it to be mirrored>

this would allow you to keep plugins different between users but have some always be the same code base. 这样一来,您可以使用户之间的插件保持不同,但某些插件始终具有相同的代码库。

Another option would be to add some conditional logic to your wp-config file that asks what domain the request is for and loads the appropriate database that way. 另一个选择是向您的wp-config文件添加一些条件逻辑,该条件逻辑询问请求的目标域并以这种方式加载适当的数据库。 This would use all identical files for all sites but you could have some plugins enabled or disabled. 这将对所有站点使用所有相同的文件,但是您可以启用或禁用某些插件。 You would still need to update the database for each site but you would only have to maintain one set of code. 您仍然需要为每个站点更新数据库,但是只需维护一组代码即可。 Something like: 就像是:

switch ($_SERVER["HTTP_HOST"]) {
  case "www.example.com":
    define('DB_NAME', 'my_database_name');
    //...etc
    break;
  case "www.anotherexample.com":
    define('DB_NAME', 'my_other_database_name');
    //...etc
    break;
}

or you could name your wordpress config files like "domain.wp-config.php" and then have your regular wp-config use code like: 或者您可以将您的wordpress配置文件命名为“ domain.wp-config.php”,然后让常规的wp-config使用如下代码:

if (file_exists($_SERVER["HTTP_HOST"].".wp-config.php") { 
  include $_SERVER["HTTP_HOST"].".wp-config.php"; 
} else { 
  print "Couldn't load configuration file for ".$_SERVER["HTTP_HOST"]; 
}

However if you're looking to use one database then WordPress multiuser is probably the best option though you may have issues with plugins in some cases. 但是,如果您要使用一个数据库,则WordPress多用户可能是最好的选择,尽管在某些情况下插件可能会出现问题。

Note that both of the code samples above are assuming that you are redirecting users from www to non-www or vice versa so that www.example.com and example.com are both taking the user to the same place. 请注意,以上两个代码示例均假设您将用户从www重定向到非www,反之亦然,以便www.example.com和example.com都将用户带到同一位置。 If you do not have a redirect in place you will need different code or duplicate entries for each version of the site. 如果没有适当的重定向,则对于每个版本的站点,您将需要不同的代码或重复的条目。

您可以创建两个wordpress副本,并在其中一个中用plugins文件夹的链接替换其中的plugins文件夹,如果添加插件,则该插件将在所有网站上都可用。

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

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