Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tompic823

    (@tompic823)

    Anyone have any insight into this?

    Thread Starter tompic823

    (@tompic823)

    I have resolved this issue. I modified the w3_get_home_url() function in inc/define.php in the w3-total-cache plugins folder. You can see below that I added a line to set the home_url variable equal to the get_home_url() WordPress function (line 3), essentially treating my setup as if it’s a multisite setup. These instructions should be sufficient should anyone else experience this issue with this unique setup.

    function w3_get_home_url() {
        static $home_url = null;
        $home_url = get_home_url();
    
        if ($home_url === null) {
            $config = w3_instance('W3_Config');
            if (w3_is_multisite() && $config->get_boolean('common.force_master')) {
                $home_url = get_home_url();
            } else {
                // get_option is unusable here, it can cause problem when objCache isn't yet initialized
                // Which is why we save the 'home' option in our ConfigCache
                // We don't just use $config->get_string, because we want the cache to rebuild
                // when 'wordpress.home' is not (yet) present
                $home_url = $config->get_cache_option('wordpress.home');
                $home_url = rtrim($home_url, '/');
            }
        }
    
        return $home_url;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: W3 Total Cache] "Replace site's hostname" not working for subdomains’ is closed to new replies.