admin管理员组文章数量:1406951
How to set up Wordpress Multisite, sub-folder setup, on multiple domains without plugin?
For expample if I have two domains www.domain-one and second www.domain-two, i would like to have sites like: www.domain-one.cz - site in root, www.domain-one.cz/anothersite/ - site in subfolder of first domain, then the same posibilities on the second domain, is it posible?
Actually i could do it on multiple domains but with change of one condition in wp-includes/ms-settings.php on line 72:
if ( $blogname != '' && ! in_array( $blogname, $reserved_blognames ) && ! is_file( $blogname ) && $domain != 'www.domain-two' )
and to be able to log into those sites you have to also put some aditional code to settings.php (this seems not necessary for new wordpress):
if($_SERVER['HTTP_HOST'] == 'www.domain-two')
define('COOKIE_DOMAIN', 'www.domain-two');
With this, quiite simple solution, you can have multiple sites but no sites with subfolders within those aditional domains, you can have subfolder sites only for main domain (and then multiple aditional domains).
Actually if there is no option to do this without plugin and without changing code of core, if there option to do ti with change of core? Or is there some plugin which can do exactly this? What about sunrise.php is it posible with this?
How to set up Wordpress Multisite, sub-folder setup, on multiple domains without plugin?
For expample if I have two domains www.domain-one and second www.domain-two, i would like to have sites like: www.domain-one.cz - site in root, www.domain-one.cz/anothersite/ - site in subfolder of first domain, then the same posibilities on the second domain, is it posible?
Actually i could do it on multiple domains but with change of one condition in wp-includes/ms-settings.php on line 72:
if ( $blogname != '' && ! in_array( $blogname, $reserved_blognames ) && ! is_file( $blogname ) && $domain != 'www.domain-two' )
and to be able to log into those sites you have to also put some aditional code to settings.php (this seems not necessary for new wordpress):
if($_SERVER['HTTP_HOST'] == 'www.domain-two')
define('COOKIE_DOMAIN', 'www.domain-two');
With this, quiite simple solution, you can have multiple sites but no sites with subfolders within those aditional domains, you can have subfolder sites only for main domain (and then multiple aditional domains).
Actually if there is no option to do this without plugin and without changing code of core, if there option to do ti with change of core? Or is there some plugin which can do exactly this? What about sunrise.php is it posible with this?
Share Improve this question edited Nov 30, 2012 at 15:24 Roman asked Nov 30, 2012 at 15:14 RomanRoman 3292 silver badges8 bronze badges1 Answer
Reset to default 3It is important that you set the constant COOKIE_DOMAIN
in the wp-config.php
define( 'COOKIE_DOMAIN', '' );
The value must be empty, otherwise WordPress will always set it to your network's $current_site->domain
and you won't be able to login into any of the other sites.
From core:
/**
* @since 2.0.0
*/
if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) {
if ( !empty( $current_site->cookie_domain ) )
define('COOKIE_DOMAIN', '.' . $current_site->cookie_domain);
else
define('COOKIE_DOMAIN', '.' . $current_site->domain);
}
Now you can set a domain in the settings of each site in the network.
本文标签: subdomainsHow to set up Wordpress Multisite on multiple domains without plugin
版权声明:本文标题:subdomains - How to set up Wordpress Multisite on multiple domains without plugin? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744907853a2631730.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论