Title: grega2's Replies | WordPress.org

---

# grega2

  [  ](https://wordpress.org/support/users/grega2/)

 *   [Profile](https://wordpress.org/support/users/grega2/)
 *   [Topics Started](https://wordpress.org/support/users/grega2/topics/)
 *   [Replies Created](https://wordpress.org/support/users/grega2/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/grega2/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/grega2/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/grega2/engagements/)
 *   [Favorites](https://wordpress.org/support/users/grega2/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [WP Multisite – Additional subdomain on each site for API purposes](https://wordpress.org/support/topic/wp-multisite-additional-subdomain-on-each-site-for-api-purposes/)
 *  Thread Starter [grega2](https://wordpress.org/support/users/grega2/)
 * (@grega2)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/wp-multisite-additional-subdomain-on-each-site-for-api-purposes/#post-15578310)
 * I have resovled it myself.
 * I have enabled sunrise in wp-config. Then add a script to sunrise.php to override
   HTTP_HOST.
 * I made it dynamic since we have many websites. When you visit api.domainxy.com
   it automatically shows you domainxy.com.
 *     ```
       $re = '/(?:api\.)(.*)/m';
       $str = $_SERVER['HTTP_HOST'];
   
       preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
   
       if ($matches && $matches[0][1] != "") {
         $_SERVER['HTTP_HOST'] = $matches[0][1];
       }
       ```
   
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [WP Multisite – Additional subdomain on each site for API purposes](https://wordpress.org/support/topic/wp-multisite-additional-subdomain-on-each-site-for-api-purposes/)
 *  Thread Starter [grega2](https://wordpress.org/support/users/grega2/)
 * (@grega2)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/wp-multisite-additional-subdomain-on-each-site-for-api-purposes/#post-15557472)
 * This steps (1,2) are not helpful… They cannot be working since you would need
   to tell WP which site to load, but you dont. Its just handles redirects.
 * Ill check plugins, but Iam sure that there has to be a simple code solution to
   that.
 * I would only need to tell WP which site to load if the url cannot be matched 
   with any existing blogs/sites….
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [WP Multisite – Additional subdomain on each site for API purposes](https://wordpress.org/support/topic/wp-multisite-additional-subdomain-on-each-site-for-api-purposes/)
 *  Thread Starter [grega2](https://wordpress.org/support/users/grega2/)
 * (@grega2)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/wp-multisite-additional-subdomain-on-each-site-for-api-purposes/#post-15550988)
 * Yes api subdomain act as a mirror. But you have to tell WP that api.domain1.com
   is a mirror for domain1.com. This is the main problem – i do not know how to 
   do that.
 * If I add api subdomain to server it redirects you to “master” domain.
 * When you go to api.domain1.com it redirects you to masterdomain.com/wp-signup.
   php?new=api.domain1.com. But api.domain1.com should be a mirror of domain1.com.
 *   Forum: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
   
   In reply to: [WP Multisite – Additional subdomain on each site for API purposes](https://wordpress.org/support/topic/wp-multisite-additional-subdomain-on-each-site-for-api-purposes/)
 *  Thread Starter [grega2](https://wordpress.org/support/users/grega2/)
 * (@grega2)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/wp-multisite-additional-subdomain-on-each-site-for-api-purposes/#post-15546356)
 * Hi,
 * I know all about how to do that… But the problem is we are having WordPress Multisite
   network. I do not know how to attach additional subdomain to each site of the
   network. Thats the main problem since API needs to be called thru the appropriate
   domain…
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Conversios: Google Analytics (GA4), Google Ads, Conversion and Analytics Tracking for Multi-Channels] Since last update gtag.js isn’t included for anonymous users](https://wordpress.org/support/topic/since-last-update-gtag-js-isnt-included-for-anonymous-users/)
 *  [grega2](https://wordpress.org/support/users/grega2/)
 * (@grega2)
 * [8 years ago](https://wordpress.org/support/topic/since-last-update-gtag-js-isnt-included-for-anonymous-users/#post-10355010)
 * Iam having the same problem… Plugin stopped working after 2.0.2 update.

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