My Wordpress multisite installation uses two sites:

Site 1: www.myexample.com
Site 2: blog.myexample.com

In addition, I own a second domain myexample2.com, which I would like to redirect to the subdomains of the original domain.

Here are its CNAME records in DNS settings:

; A Records
@   600  IN     A   xxx.xxx.xxx.xxx

; CNAME Records
blog    600  IN     CNAME   blog.myexample.com
www 600  IN     CNAME   www.myexample.com

The problem is that when calling blog.myexample2.com the home page www.myexample.com gets loaded instead of blog.myexample.com.

The problem seems to be in some Wordpress setting, wp-config.php may be causing this.

Part of wp-config.php related to Multisite:

/* Multisite */
define( 'WP_HOME', 'https://www.myexample.com' );
define( 'WP_SITEURL', 'https://www.myexample.com' );
define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'www.myexample.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 2);

define( 'NOBLOGREDIRECT', 'https://www.myexample.com' );
  • have you created the site "blog.myexample2.com" in the network administration ?
    – Kaperto
    Nov 11, 2019 at 23:00
  • Why would blog.myexample2.com load blog.myexample.com? It doesn't make sense
    – Tom J Nowell
    Nov 11, 2019 at 23:00
  • @Kaperto I have only created “blog.myexample.com” site in network administration. Calls to “blog.myexample2.com” should be redirected to that site. Nov 11, 2019 at 23:08
  • 1
    @PeterGerhat domain redirects and domain mappings are 2 completely different things, can you edit your question to reflect that you meant redirecting, not mapping?
    – Tom J Nowell
    Nov 11, 2019 at 23:09
  • then try to set NOBLOGREDIRECT to https://blog.myexample.com
    – Kaperto
    Nov 11, 2019 at 23:13


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.