By newbie
Hello, im trying to achieve the following
main wordpress installation for mysite1.com 2nd site using WP multi-site(sub-directory) mysite.com/abc 3rd site using WP multi-site (domain maping) anothersite.com
all 3 above with 1 single wordpress installation. i checked couple of tutorials but a bit confused that wordpress sub-directory and custom domain can be installed in single wordpress or not.
some detailed instruction would be appreciated. thank you.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello. I hope I’m not too late. But, I have bad news for you. :(
This is not possible with one WP installation. This is a quote from WP Codex - Create A Network:
You must choose one or the other. You can reconfigure your network to use the other choice after installation, despite the advice on the screen, but reconfiguring it might not be easy.
I’ve setup one Droplet with it and verified that it’s no possible to do it. Codex: Before You Create A Network Codex: Create A Network.
I’m not sure that you would be able to setup as you want. You would be able to setup first and second site, but I’m not sure that third is supported by Multisite.
Multisite supports sub-directory or sub-domain:
e.g. for sub-directory: example.com & example.com/blog
e.g. for sub-domain: example.com & blog.example.com
But there isn’t option for: example.com & example.org
Maybe it’s possible to tweak but as I said I’m not sure in it.
You can always go with multiple sites, it could be even easier in your case
Setting up a WordPress Multisite Network with Nginx, allowing for both subdirectory and domain mapping, can be a bit complex, but it’s definitely achievable. Here’s a step-by-step guide:
Install WordPress: First, ensure you have a standard WordPress installation set up on mysite1.com.
Enable Multisite:
wp-config.php in your WordPress root directory./* That's all, stop editing! Happy publishing. */, add:/* Multisite */
define('WP_ALLOW_MULTISITE', true);
Setup Network:
wp-config.php and .htaccess files. For Nginx, you’ll use the wp-config.php changes but will need a different approach for Nginx configuration.You’ll need to edit your Nginx configuration. This usually resides in /etc/nginx/sites-available/ or a similar directory.
Basic Configuration:
mysite1.com.location / {
try_files $uri $uri/ /index.php?$args;
}
Subdirectory Rules:
mysite1.com/abc) automatically.Domain Mapping:
anothersite.com, create another server block in Nginx that points to the same WordPress installation directory.server_name:server {
server_name anothersite.com;
root /path/to/wordpress;
# Include the rest of your WordPress config here...
}
wp-config.php and update the multisite settings provided by WordPress during the network setup.DOMAIN_CURRENT_SITE to your main site’s domain.mysite1.com/abc, add a new site using the subdirectory option.anothersite.com), you’ll need a domain mapping plugin or WordPress 4.5+ which supports domain mapping natively. Add anothersite.com as a new site, then map the domain.anothersite.com is pointed to the same server as mysite1.com.This setup allows a single WordPress installation to serve multiple sites, both in subdirectories and with separate domains. Remember, the exact Nginx configuration might vary based on your server’s setup and WordPress version. Ensure to restart Nginx after making configuration changes.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.