Jump to content

running WordPress on multi-site environment - ways to get there.


Recommended Posts

hello Feaks 


hope youre all right and everything goes well in your home-town. Have a happy new year - and stay healthy. 

have a happy new year. 


ever wanted to work with WordPress multisite, but if so - you wanted to be able to use your own names. For example your main site is named example.com. 
If you want to add a new site to your multisite network it's gonna be called newsite.example.com: Suppose you want to be able to visit newsite.com without example. 

good news: there is a way to achieve this?

first steps to achieve this: 
setup: https://codex.wordpress.org/Installing_WordPress
configuring: https://codex.wordpress.org/Create_A_Network

we have to configure the DNS Records (Nameservers) for the Custom Domain:

some steps to do so: 
a.  we need to make sure that our custom domain name points to our hosting server.
b.  for the setup of different domain and hosting accounts (recommendet), we to repeat the steps to set up the network’s main domain name (i.e. the primary domain on which we ve installed WordPress).

it is pretty important that we configure the custom domain’s DNS records manually. 
Note: There is no special single catch-all process, since the method will depend on which domain registrar hosting provider we are going to use.

here is a sample configuration for the wp-config.php file in the base directory of the WordPress installation:

/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
define( 'DOMAIN_CURRENT_SITE', 'www.primary-domain.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

here's the basic configuration for the .htaccess file as a subdomain configuration,  in the base directory of the WordPress installation:

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]

# BoF WordPress cf: https://gist.github.com/domantasg/c68a3e8d180006efde3e5797a89e738f

# EoF WordPress
.....to get TLD's to work properly,  we can do some additional configurations to the wp-config.php file like the following.,..

define( 'COOKIE_DOMAIN', '' );
define( 'ADMIN_COOKIE_PATH', '/' );
define( 'COOKIEPATH', '/' );
define( 'SITECOOKIEPATH', '/' );

cf: https://wordpress.stackexchange.com/questions/251116/how-to-use-wordpress-multisite-with-different-domain-names

best practice:

- one Apache Virtual Host for the primary domain in the network and then 
- configure that virtual host with alias domains. Each alias domain being one of the additional sites in the network.

links for more infos:


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.