# ERR_TOO_MANY_REDIRECTS with Multisite

**URL:** https://discourse.roots.io/t/err-too-many-redirects-with-multisite/23969
**Category:** trellis
**Tags:** woocommerce, bedrock, trellis
**Created:** 2022-09-27T20:27:46Z
**Posts:** 4
**Showing post:** 2 of 4

## Post 2 by @craigpearson — 2022-09-29T23:20:20Z

The site redirecting to the sign up page is likely due to WordPress not knowing about your site, and is therefore prompting you to configure one.

I’d suggest modifying your multisite config to:

```
Config::define('WP_ALLOW_MULTISITE', true);
Config::define('MULTISITE', true);
Config::define('SUBDOMAIN_INSTALL', true);
Config::define('DOMAIN_CURRENT_SITE', env('DOMAIN_CURRENT_SITE'));
Config::define('PATH_CURRENT_SITE', env('PATH_CURRENT_SITE') ?: '/');
Config::define('SITE_ID_CURRENT_SITE', env('SITE_ID_CURRENT_SITE') ?: 1);
Config::define('BLOG_ID_CURRENT_SITE', env('BLOG_ID_CURRENT_SITE') ?: 1);

Config::define('COOKIEPATH', '/');
Config::define('SITECOOKIEPATH', '/');
Config::define('ADMIN_COOKIE_PATH', '/');
Config::define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
```

I would then check the `wp_blogs` table in your database to ensure it looks like:

```
| blog_id | url | path |
| 1 | staging.siteone.com | / |
| 2 | staging.sitetwo.com | / |
```

Check your `wp_site` table looks like:

```
| site | url | path |
| 1 | staging.siteone.com | / |
```

Check `wp_sitemeta` has the following:

```
| option_name | value |
| siteurl | http(s)://staging.siteone.com/wp |
| subdomain_install | 1 |
```

Check `wp_options` has the following:

```
| option_name | value |
| siteurl | http(s)://staging.siteone.com/wp |
| home | http(s)://staging.siteone.com/wp |
```

Check `wp_2_options` has the following:

```
| option_name | value |
| siteurl | http(s)://staging.sitetwo.com/ |
| home | http(s)://staging.sitetwo.com/ |
```

As you have been redirected several times your browser will cache this so ensure you clear your cookies / disable local cache. Or use `curl -i` for debugging redirects.

I would first disable the multisite URL fixer too, and enable once you’ve hit your homepage on both sites.

Finally make sure your Trellis `wordpress_sites.yml` config is correct. I suspect that when you have performed your rewrites, you have rewritten URLs twice.

When rewriting with WP CLI, you have to remember that there are two types of url, so a network rewrite after a normal rewrite can be quite destructive. For example:

```
wp search-replace example1.com staging.example1.com
```

Followed by:

```
wp search-replace example1.com staging.example1.com --network
```

Will result in some tables having `staging.example1.com` and some having `staging.staging.example1.com`.

---

_[View the full topic](https://discourse.roots.io/t/err-too-many-redirects-with-multisite/23969)._
