admin管理员组文章数量:1313347
I am setting up a Wordpress Network Multisite solution - and expect to serve distinct domains e.g.
- www.builder
- www.tailor
- www.chef
These will be set within the /wp-admin/network/site-info.php?id=2 page - in the "Site Address(URL)" field.
I have three environments - each on a different physical device;
- local.* (local development)
- uat.* (customer staging / sign off)
- www.* (production)
I will be using GIT to push custom code, WP & plugin updates from local > dev > www
The entire database will be cloned from www > dev | local - in order to recreate issues when required.
What approach should I use to programmatically define the subdomains such that I do not need to update database tables every time I restore a backup from www to local?
I did this on standard WP using the machine the code was running on to determine the url:
//Decide which subdomain to serve
$subdomain = "local.";
$var_hostname = gethostname();
$reqDom = $_SERVER['HTTP_HOST'];
if (strrpos($var_hostname, "dev") > -1) {
$subdomain = "uat.";
} else if (strrpos($var_hostname, "web") > -1) {
// web host found... must be LIVE
$subdomain = "www";
}
define('WP_HOME', 'https://' . $subdomain . 'chef');
define('WP_SITEURL', 'https://' . $subdomain . 'chef');
I've tried the following filter but with no success:
// Derive which URL's to use - along with multisite
function my_filter_option_siteurl($siteurl) {
// filter $siteurl here
return getSanitisedEnvURL($siteurl);
}
本文标签: Wordpress Folder Multisitedevstagingwww versions
版权声明:本文标题:Wordpress Folder Multisite - dev, staging, www versions 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741947941a2406535.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论