372 Wiki 372 Wiki

  • Home
  • Forums
  • Categories
    • Billing
    • Bookkeeping
    • Copyright & Legal
    • Clients
    • Designer Guides
    • Developer Guides
    • Getting Started
    • Troubleshooting
    • Workplace
Home / Developer Guide / WordPress Multi-Site Deplyment

WordPress Multi-Site Deplyment

26 views 1 min , 28 sec read 0

IMPORTANT – TAKE A BACKUP OF THE SITES DATABASE BEFORE ACTIONING THE BELOW

The following will guide you to getting a WordPress multi-site deployed to staging or live.

Make sure that you have the follwing plugin installed.

WP Migrate DB – https://en-au.wordpress.org/plugins/wp-migrate-db/

When installed and activated. Head over to Network Admin -> Settings -> Migrate DB

For the settings:

  • Keep Export File and checkboxes all checked
  • Make sure Find & Replace is unchecked otherwise it will find and replace in the currents site DB. It will break the site.
  • Expand Advanced options and uncheck Replace GUID’s

For the find and replace. the first will be prefilled based on where you are exporting from. You want to then enter in the first replace input box the new url. In this instance it was //www.cuc.edu.au its important that all websites home URL is set to www. Non-www is usually reserved for emails.

Second Find and Replace is the servers file location. This you only need to do once. First will be prefilled automatically. In the above instance the new file path will be /home/cucedu/public_html 

When you are happy click export and then create a new database and then upload this database up.

Make sure htaccess is the same as when it was set up locally, it should be similar to this below.

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]

Also make sure to copy multi-site configuration made in wp-config locally and make edits to the “Domain_current_site” to be the new sites domain.

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'cuc.edu.au');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
// define( 'COOKIE_DOMAIN', '' );
define( 'ADMIN_COOKIE_PATH', '/' );
define( 'COOKIEPATH', '/' );
define( 'SITECOOKIEPATH', '/' );

Now with multi-sites you may face the following issue. Say one of the multi-sites the home address is www.cucfarwest.edu.au and you enter cucfarwest.edu.au. You will always be redirected back to the main sites domain which in our case was www.cuc.edu.au. If you are facing this, make sure to add this to the top of WordPresses .htaccess after RewriteEngine on

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [L,R=301]
Developer Guide

About James Apoefis

View all posts by James Apoefis →

Related Articles

  • cPanel Redirect Old to New Site using htaccess
  • Version Control
  • JA Theme Setup Documentation
  • Website and Application Development Workflow

Article Categories

  • 9Billing
  • 3Bookkeeping
  • 2Cimara
  • 5Client
  • 11Copyright & Legal
  • 2Designer Guide
  • 18Developer Guide
  • 11Getting Started
  • 2Troubleshooting
  • 10Workplace

Most Viewed

  • Using my credit 113
  • What is WordPress? 65
  • Account overview 51
  • Why can’t I download the latest theme version (zip file)? 50
  • How do you customize the navigation? 49

Most Liked

  • Using my credit 5
  • Why can’t I download the latest theme version (zip file)? 3
  • What is WordPress? 2
  • Account overview 1
  • Authentication policy 1

Article Categories

Billing Bookkeeping Cimara Client Copyright & Legal Designer Guide Developer Guide Getting Started Troubleshooting Workplace

Any questions

For all management related matters please refer to Ben Brillante

For any Cimara functional issues please refer to Rushabh Padalia.

For client based issued please refer to James Apoefis

© Copyright 372 Digital Pty Ltd. All rights reserved.