Three step to mapping domain without plugin:
I prefer to have the ability to implement separate conf blocks under separate domains, it keeps things less sloppy and more organized.
Here’s what you do to implement it this way:
Create your initial site. Then, to add another that uses the same root directory run:
wo site create second-site.com --php
Note: it has to be --php so that the index.php file Wordpress creates is looked for by NginX - otherwise it will look for an index.html. Now just go to the .conf for the domain you just added - /etc/nginx/sites-available/second-site.com, open it and edit this line from:
And change it to:
Restart NginX for the changes to take effect and you’re done. It takes less than a minute and is super easy to do. IMO, far quicker and more maintainable than hacking the default conf file.
Wo site update second-site.com --le
Check this wordpress official document
If you get an error about cookies being blocked when you try to log in to your network subsite (or log in fails with no error message), open your wp-config.php file and add this line after the other code you added to create the network:
and set second-domain on subsite by editing site on multiste dashboard.
4# restart nginx