WP a system N-blog
WP does not support multiple sites, so when you want to create multiple wp blog when you have to install multiple wp systems, and more trouble to maintain. Online to see a very good idea, it should be feasible in a system to create multiple wp blog, but there should be a lot of details to consider, but also why there is a likelihood MU. No matter how still a very idea of cattle. Sum up, when to test.
The principle is very simple, wp the use of database management data, so if you want in a WP system, for different visitors request, to access different databases (or inside a database with different data), then it is easy to achieve This feature in the wp-config.php there are added to this paragraph:
1 2, 3, Four Five Six Seven Eight 9, Of 10 11 12 13 14 15 16 17 18 19 | $_SERVER [ "HTTP_HOST" ] == "eric.ericbess.com" ) { if ($ _SERVER [ "HTTP_HOST"] == "eric.ericbess.com") ( 'DB_NAME' , 'ericbess' ) ; define ( 'DB_NAME', 'ericbess'); 'DB_USER' , 'eric' ) ; define ( 'DB_USER', 'eric'); 'DB_PASSWORD' , '***' ) ; define ( 'DB_PASSWORD','***'); 'DB_HOST' , 'localhost' ) ; define ( 'DB_HOST', 'localhost'); 'DB_CHARSET' , 'utf8' ) ; define ( 'DB_CHARSET', 'utf8'); 'DB_COLLATE' , '' ) ; define ( 'DB_COLLATE',''); 'eric_' ; $ table_prefix = 'eric_'; 'WPLANG' , 'zh_CN' ) ; define ( 'WPLANG', 'zh_CN'); ( $_SERVER [ "HTTP_HOST" ] == "bess.ericbess.com" ) { ) Else if ($ _SERVER [ "HTTP_HOST"] == "bess.ericbess.com") ( 'DB_NAME' , 'ericbess' ) ; define ( 'DB_NAME', 'ericbess'); 'DB_USER' , 'bess' ) ; define ( 'DB_USER', 'bess'); 'DB_PASSWORD' , '***' ) ; define ( 'DB_PASSWORD','***'); 'DB_HOST' , 'localhost' ) ; define ( 'DB_HOST', 'localhost'); 'DB_CHARSET' , 'utf8' ) ; define ( 'DB_CHARSET', 'utf8'); 'DB_COLLATE' , '' ) ; define ( 'DB_COLLATE',''); 'bess_' ; $ table_prefix = 'bess_'; 'WPLANG' , 'zh_CN' ) ; define ( 'WPLANG', 'zh_CN'); ) |
Obviously, this configuration file will be based on different $ _SERVER [ "HTTP_HOST"] to give a different configuration database table, a data table prefix is bess_ while the other one is eric_, even in the same database which would not conflict With their own independent database configuration, in the same good Wordpress optimization system to non-interfering with the operation, along with the theme of different styles, and plug-ins, their selective use.
Notes
- All plug-in data table design attention plus the prefix: $ table_name = $ wpdb-> prefix. "Plugin_table_name"; (In fact, most of the development of both plug-ins to do so, and now reflect the benefits to the)
- Sub-domain binding wp (can not do the path of Jump): name-based virtual host / rewrite (I do not know whether it is feasible)
- To the control of the database built Account number: (high security, optional)
mysql> grant select, insert, update, delete on ericbess.eric_ to eric @ "%" Identified by "eric_password";
mysql> grant select, insert, update, delete on ericbess.bess_ to bess @ "%" Identified by "bess_password";
Envisaged above without a test, need to test the feasibility demonstration!














































