# Domain mapping only works with wp-admin, home redirects to main

**URL:** https://discourse.roots.io/t/domain-mapping-only-works-with-wp-admin-home-redirects-to-main/24608
**Category:** bedrock
**Tags:** multisite
**Created:** 2023-01-19T20:17:14Z
**Posts:** 3

## Post 1 by @bjoernbear — 2023-01-19T20:17:14Z

Hi!  
I have a major problem and an urgent one as well.  
I can’t get my domain mapping working correctly. I can only get the wp-admin to work, but the front just redirects to the main blog.

This is my setup for multisite. Using the config:: just breaks everything.

```
/**
 * Multisite Network
 */
define('WP_ALLOW_MULTISITE', true);
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
define( 'DOMAIN_CURRENT_SITE', env('WP_MULTISITE_HOME'));
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

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

And this is my related env.

```
WP_ENV='development'

WP_HOME='https://domain.com'

WP_MULTISITE_HOME='domain.com'

WP_SITEURL="${WP_HOME}/wp"

WP_DEBUG_LOG=/path/to/debug.log
```

What am I missing?

---

## Post 2 by @EHLOVader — 2023-01-19T22:17:53Z

It is archived so not sure if it is still relevant but when I was looking into multisite I used this plugin to fix some routing issues.

> **[GitHub - roots/multisite-url-fixer: Fixes WordPress issues with home and site...](https://github.com/roots/multisite-url-fixer)**
>
> Fixes WordPress issues with home and site URL on multisite when using Bedrock - GitHub - roots/multisite-url-fixer: Fixes WordPress issues with home and site URL on multisite when using Bedrock

It may still be relevant.

---

## Post 3 by @bjoernbear — 2023-01-19T22:28:46Z

Thank you for your reply!

I’m currently using that plugin. But it does not resolve the issue, sadly. I even tried removing it, without any difference.

Can’t find anyone with the same problem…

UPDATE:

Well, the error was on my behalf. Forgot about my custom redirect script for hidden sites…
