Wordpress Multi-Site Configuration
Table of contents
Add the below line to wp-config.php
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
/* add below: "That’s all, stop editing! Happy blogging."*/
Navigate to wp-admin
dashboard
- Tool > networking setup
-
Copy the required lines
define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', false ); define( 'DOMAIN_CURRENT_SITE', 'www.example.com' ); define( 'PATH_CURRENT_SITE', '/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 );
- Paste to
wp-config.php
under the commentHappy blogging
line. - Navigate to:
https://www.example.com/wp-admin/network/setup.php
- Note: defining
current site
would be the default site of this multi site configuration.
Multi-site domain mapping
- Download
wordpress-mu-domain-mapping
plugin and network activate enabled - Run
cp /var/www/www.example.com/wp-content/plugins/wordpress-mu-domain-mapping/sunrise.php /var/www/www.example.com/wp-content/
- Navigate in Network configuration > Settings > Domain Mapping, point to the server address, either A NAME or CNAME as server.
- Tick box for
Permanent redirect
&User domain mapping page
, and leave others un-ticked. - Go to the subdomain site, Tools > Domain mapping, add the custom domain and tick as primary.
Migrate multi site from server to server
- Export mysql database
- Compress the entire site folder into
.zip
file and download from old server - Import mysql database to new server
- Upload site to new server
- Change
wp-config.php
file to with new databasetable-name
/user-name
/password
- Update SSL