[resolved] Setting up a new multisite install while using an alias for the primary domain (1 post)

  1. randmanrjr
    Posted 3 years ago #

    We have a new client who currently has a WP site with another hosting provider using their registered domain: clientdomain.org

    We are building the client a new WP multisite using subdirectories that we will host using MT.
    This is our first time using multisite for a client.
    We provide hosting via Media Temple on a dv4.

    Normally, in this scenario, we usually do the following to facilitate building the clients new site while their current site is still online:

    We create a subdomain on our server: newclient.ourserver.com
    We point that subdomain to the IP of the server the site will be hosted on.
    We add the customer's domain (clientdomain.org) to the server the site will be hosted on.
    We create an alias for the customer's domain that is the same as newclient.ourserver.com.
    We then edit the wp-config.php to define both WP_HOME and WP_SITEURL as newclient.ourserver.com

    This usually works fine for single WP sites, and when the site is ready to go live, when change the WP_HOME and WP_SITEURL to the clients registered domain. Then change the DNS records for the clients domain.

    This workflow does not appear to work for a WP multisite subdirectory installation...

    I add all of the necessary constants to the wp-config.php and .htaccess files to enable multisite.


    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'newclient.ourserver.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);


    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    As soon as I add the necessary constants to the wp-config.php file for multisite; all of the links off the wp-login page or the main alias url link to the customer's current wp site; this prevents me working on the clients new WP multisite.

    Is there a better workflow for setting up a WP multisite when the primary domain is already in use?

Topic Closed

This topic has been closed to new replies.

About this Topic