# Proper way to handle WP_HOME within a multisite

**URL:** https://discourse.roots.io/t/proper-way-to-handle-wp-home-within-a-multisite/27803
**Category:** bedrock
**Tags:** multisite
**Created:** 2024-07-23T09:10:29Z
**Posts:** 3

## Post 1 by @Mehk — 2024-07-23T09:10:29Z

The WP\_HOME .env property is confusing to me. By default it has these values:

```
WP_HOME='http://example.com'
WP_SITEURL="${WP_HOME}/wp"
```

But what if you have a multisite with sites using the exact same theme (not a child theme)? So:

Site A: [example.com](http://example.com)  
Site B: [example-b.com](http://example-b.com)

Site A is fine, Site B is mostly fine but is trying to fetch plugin assets and such from Site A which isn’t nice and results in CORS errors.

This can be fixed by adding changing the WP\_HOME in application.php with:

```
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
```

Perhaps this is wrong and there is probably a reason for doing it like this. But can someone tell me what the proper practice is?

---

## Post 2 by @Mehk — 2024-07-26T05:05:41Z

Still looking for help on this, any experience with your own projects would be much appreciated!

---

## Post 3 by @Mehk — 2024-08-02T12:21:48Z

Unfortunately using the above solution breaks the WP CLI with:  
`PHP Warning: Undefined array key "HTTP_HOST"`

e.g. when doing `wp cap list 'administrator'`
