admin管理员组文章数量:1315960
I am trying to connect my local wordpress multisite to my staging database. It works perfect when I am not on a multisite but with the multisite I can't find a way to change the value of the main domain url...
I have tried altering the define( 'DOMAIN_CURRENT_SITE', 'mywebsite.local' );
but it doesn't work.
Any idea on how to go about developing locally a multisite while sharing the database with the staging environment?
Edit
To make it work on a single site install I just alter a bunch of constant to change the main directories url like so:
$domain = 'mywebsite.local';
$directory = 'subdirectory' // only when needed;
define( 'WP_SITEURL', $domain . $directory );
define( 'WP_HOME', $domain . $directory );
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . $directory . '/wp-content' );
define( 'WP_CONTENT_URL', $domain . $directory . '/wp-content' );
define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . $directory . '/wp-content/plugins' );
define( 'WP_PLUGIN_URL', $domain . $directory . '/wp-content/plugins' );
define( 'PLUGINDIR', $_SERVER['DOCUMENT_ROOT'] . $directory . '/plugins' );
Thanks for your help!
本文标签: wp configUse external database with local multisite
版权声明:本文标题:wp config - Use external database with local multisite 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741988829a2408846.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论