开发者

Wordpress - Multisite network and domain mapping plugin questions

开发者 https://www.devze.com 2023-02-24 08:23 出处:网络
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

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.

I want to run all these different wordpress sites off my cms so if I update the plugins/wordpress on one i开发者_开发知识库t will update across the board. This is to ensure we're not running several sites with several different versions of plugins or indeed a different version of 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:

  1. Using the wordpress network along with the Wordpress MU domain mapping plugin, what impact would this have on seo for each site?

  2. I'm guessing there would be one central place to upgrade both wordpress and the plugins across all the domains? Would this still allow me to choose different settings for each domain on the plugins? I.e 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

4/14/11 edits: There's no SEO impact. 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=


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. 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. 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:

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.

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. If you do not have a redirect in place you will need different code or duplicate entries for each version of the site.


you can create two copies of word press and replace the plugins folder in one of them with a link to the the plugins folder in the other one now if you add a plugin it'll be available to all the websites.

0

精彩评论

暂无评论...
验证码 换一张
取 消