Title: Multisite problems
Last modified: September 22, 2016

---

# Multisite problems

 *  Resolved [tim.samuelsson](https://wordpress.org/support/users/timsamuelsson/)
 * (@timsamuelsson)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/multisite-problems-10/)
 * Hi,
 * Im running a multisite setup with domainmaped subsites.
 * The problem is that the plugin is using homeurl as the URL to make purge requests.
 * I my case the homeurl is “mastersite.com” and i have “subsite1.com” and “subsite2.
   com”. In wp admin the urls is “mastersite.com/subsite1” and “mastersite.com/subsite2”.
 * It works when i update posts because i added the following filter:
 *     ```
       add_filter('vhp_purge_urls', function ($urls, $postId) {
           $mappedDomain = domain_mapping_siteurl([]);
           $adminUrl = home_url();
   
           foreach ($urls as &$url) {
               $url = str_replace($adminUrl, $mappedDomain, $url);
           }
   
           return $urls;
       }, 10, 2);
       ```
   
 * When I using the global button in the admin bar i endup in the function purgeUrl(
   Row 248).
 * When that method is called on row 231 in executePurge its looks like this:
    `
   $this->purgeUrl( home_url() .'/?vhp-regex' );`
 * My problem is that the home_url is mastersite.com/subsite1 and not subsite1.com.
 * Im using this plugin for domain mapping: [https://sv.wordpress.org/plugins/wordpress-mu-domain-mapping/](https://sv.wordpress.org/plugins/wordpress-mu-domain-mapping/)
 * Would it be possible for you to fixe the plugin so it works when i use multisite
   with domainmapping?
 * You can use the function `domain_mapping_siteurl([])` to get the domainmapped
   site_url.
 * Many thanks
 * //Tim Cifuentes Vargas

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Contributor [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [9 years, 8 months ago](https://wordpress.org/support/topic/multisite-problems-10/#post-8211121)
 * The home_url() should be the DISPLAYED URL of your site.
 * So home_url should be subsite1.com and site_url should be mastersite.com/subsite1…
 * I thought that plugin actually did a filter on home_url() across the board so
   it always returned the value of what should display on the front end, but I guess
   not. Huh.
 * Really the right fix would be to have a filter change all instances of home_url()
   to it’s mapped domain, since a lot of other themes and plugins rely on that, 
   and you’ll get inconsistent URLs otherwise.
 * Meantime, I can make that filterable, though I have to see if that has any unintended
   consequences.
 *  Plugin Contributor [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [9 years, 8 months ago](https://wordpress.org/support/topic/multisite-problems-10/#post-8256939)
 * FYI a filter for this will be included in v 4.0. It’s waiting on some WP-CLI 
   fixes before I can push it out.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multisite problems’ is closed to new replies.

 * ![](https://ps.w.org/varnish-http-purge/assets/icon-256x256.png?rev=3027185)
 * [Proxy Cache Purge](https://wordpress.org/plugins/varnish-http-purge/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/varnish-http-purge/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/varnish-http-purge/)
 * [Active Topics](https://wordpress.org/support/plugin/varnish-http-purge/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/varnish-http-purge/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/varnish-http-purge/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/multisite-problems-10/#post-8256939)
 * Status: resolved