• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question WP Multisite with sub domain and Nginx

WhiteTiger

Basic Pleskian
I have to create a WordPress multisites to manage multiple domains.

Where can I find a recent guide to install Wordpress multisites with sub domain under Nginx and Onyx?
I found a lot of pages or related to Apache or related to other panels, but nothing about my system configuration.
Or also are very old guides still refer to the plugin for multisites, now abandoned.
  1. My hosting is 1and1.
  2. All domains are created in Plesk. Both the domain with WP multisites, and all other domains to be addressed to the main one with WP.
  3. I have only one static IP Address.
  4. Wordpress is installed by Plesk.
Thanks in advance.
 
Last edited:
Hi WhiteTiger,

the official wordpress documentation is always the best place to find ( current ) suggestions and examples:



If you need further help, pls. consider to describe your issues/errors/problems, provide informations about your operating system, the used PHP - handler and to make your informations perfect, include as well possible ".htaccess" - files, additional used HTTP/HTTPS directives, additional used nginx directives and don't forget your "wp-config.php" ( without sensible data as password, db-name, etc.!!! ).
 
Many thanks for the tips. I will read everything carefully.
But I see that mostly are Nginx scripts.
I'm rather looking for a general guide to implement these, but also the mapping of domains to sub domains of WP multisites.
In codex and in the link of Linulex there are instructions related to the "Domain Mapping Plugin". This plugin is no longer needed because the mapping mechanism is already implemented in newer versions of WP (I have the 4.7.3 version), but it is not clear how to activate it, for example how to configure DNS.

The goal is obviously to keep separate the various domains also with the management of WP multisites.
In other words, I want to see the page "domain01.com/page1" always with this URL, and not as "domain01.maindomain.com/page1".

At the moment this is my situation.

Domains
  1. I registered the domain "maindomain.com"
  2. I registered domains "domain01.com", "domain02.com" ...
  3. I created the subdomain "* .maindomain.com"
Wordpress.
  1. In "maindomain.com" I installed and configured WP multisites for subdomains.
  2. In this I created the sites "domain01.maindomain.com", "domain01.maindomain.com", ...
  3. In each of these, in "Edit / Settings / Siteurl" and "Edit / Settings / Home" I changed the URL to "Domain01.com", "http://domain02.com" ...
Plesk
  1. In Plesk I have changed "Hosting Settings" of each domain with a forward 301 to "http://domain01.maindomain.com", "http://domain01.multidomain.com", ...
    But after the change in WP the siteurl, now we no longer see the original name of the site, but the URL of the domain.
  2. I also tried the forward 301 to only "http://maindomain.com"
Now calling "http://domain01.com" or another domain, I see always "maindomain.com", not the related site.

Please be patient, but this is my first multisites installation with mapping. Furthermore I new are also with Plesk. Until now I have always worked in a hosting environment.

Many thanks again to your help.
 
Last edited:
I'm sorry, but I'm really confused.

The good news is that I've made the domains map to the main WP domain.
I removed the 301 redirect and in the DNS I made an alias: subsite.maindomain.com ALIAS OF domain.com.

But now I have to map a subdomain and I not able to do this. I tried using :blog.domain.com CNAME blog.maindomain.com
With this, when I call blog.domain.com I see maindomain.com, not the subsite.

Another problem is that the subsite not mapped is not accessible.
In other words if I configured in WP the subsite blog2 with URL http://blog2.maindomain.com, when this is called appears the Plesk error: "If you are seeing this message, the website for blog2.maindomain. com is not available at this time. "
Meanwhile, from the backend if I try to open his dashboard have a Nginx Error 404 at the address blog2.maindomain. com/wp-admin.

But my biggest problem is in the nginx configuration that I have to include in Web Sites & Domains / DOMAIN / Apache & Nginx Settings / Additional nginx directives
I have tried different configurations, taken from examples in Codex and Nginx's Wiki, as well as from various other websites, but I've always got "... nginx error: "server" directive is not allowed here in ...". Can you tell me a configuration that can surely work?
  1. I work with the standard configuration: php 7.0.17 FPM served by NGINX.
  2. I did an install from scratch, with only enabled Akismet and iThemes Security plugins (not yet configured).
  3. Surely I will activate W3 Total Cache.
These are the my Additional nginx directives:

# Rewrite rules for WordPress Multi-site.
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
}
Many thanks.
 
Last edited:
is the issue solved? is I need to change the nginx configuration for getting domain mapping worked?
 
Back
Top