Viewing 7 replies - 1 through 7 (of 7 total)
  • Can this be done on a single multisite installation?

    Maybe.

    WordPress itself does not support such a setup: it’s either subdomain or subdirectory/path… but not both.

    The WP Multi Network plugin — which allows creating multiple networks on one WordPress multisite installation — should get the job done. But it’s not been updated for the latest version of WordPress, so I have no idea if it still works or not.

    https://www.ads-software.com/plugins/wp-multi-network

    Good luck!

    Thread Starter Keith

    (@keithkhl)

    Thank you for the quick feedback!

    I am currently using that plugin for many of my multisites, but all of them are under subdomain. I’ve also checked the plugin’s code the other day, and I feel it is safe to use the old version until WP’s PHP ver 7.4 is deprecated. There are a few hiccups, like incompatibility with Redis Object Cache, but I still keep it for many purposes of website control.

    Anyways, I’ve looked into your suggestion, but it seems like I really prefer to separate user base from subdomains and subdirectories. Is there a way to do this by two WP installations, while keeping the main domain separate from subdirectories? i.e. WP installation only for subdirectories?

    • This reply was modified 6 months, 1 week ago by Keith.

    I’m kind of looking for a similar solution. I’ve installed a directory-based multisite (example.com, example.com/subsite1, example.com/subsite2…), but I was wondering if I could change the URL in the Info tab of the site (when editing the setting of the site) in order to reache the site with subsite1.example.com, subsite2.example.com as we would normally do with a custom domain.

    All plugins seems out-of-date…

    Thread Starter Keith

    (@keithkhl)

    Due to complication in Nginx configuration for the subdirectory-only multisite, I ended up with a single WP installation with WP Multi Network.

    I have initially added all subdirectory pages to the 2nd multisite network, and separated Nginx configuration for main+subdirectories and subdomains. Once done, I deactivated the 2nd network. There are a few hiccups, but this set up works for me now.

    I have been using the multi network plugin for about half a year with many networks. At first, I thought I could combine all my websites into one giant network, but it turned out that user overlap and incompatibility with a few caching plugins were a little too much to handle. I broke the giant network into pieces. And even with a smaller network, I still find the incompatibilities block the way I use WP, so I only use WP Multi Network when it is needed for specific purposes.

    A single WP network with admin.example.com, main domain, 2 subdomains, and 3 subdirectories work for me. A few multidomain supporting plugins do not seem to fit well, but I create code snippets to handle them. Should be fine, after a few days of fine-tuning.

    @keithkhl do I understand that you managed to run a multisite installation with both subdomains and subdirectories?alongside, with a code snippet? Mind to share your recipe?

    • This reply was modified 6 months, 1 week ago by brookjacoby.
    Thread Starter Keith

    (@keithkhl)

    1. Installed WP for multisite + subdomain version
    2. Nginx setting – two tracks
      • Mainsite+subdirectory : Use sub-directory configuration
      • Subdomains: Use sub-domain configuration

    I have recently added sub-directory websites to the mainsite, with the help of WP Multi Network plugin, but it doesn’t seem it was needed. Just add more subsites, and change the domain name accordingly.

    There are a number of hiccups that I experience daily, so not sure if it will work with others though. For example, in this morning, I had trouble accessing admin’s editing pages due to some unknown error. After hours of searching, I found that it was due to missing Nginx configuration for ‘location ~ /wp-json’. For sub-domain, I had months of configuration update, and seems like I have to do the same for subdirectories.

    Hope this helps.

    Thanks for sharing. But with my knowledge level, I’m not sure to try this, furthermore if you say that you encounter hiccups and I’m not on a Nginx server (just realized you are, should have read more thoroughly)

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Multisite with sub-domain and sub-directory’ is closed to new replies.