how to redirect main domain to subfolder multisite main subsite without plugin

Question

Lol sorry for the title.

I’ve taken 3 sites, 1 of which was the primary site (primarySite.com), two others were addon sites, and migrated them to a multisite network located in public_html/multisite/. The original sites still exist on the server alongside the new multisite network.

Currently, my multisite subsites look like this:

  • primarySite.com/multisite (Main)
  • addonSite1.com
  • addonSite2.com

I’ve been able to successfully map two of the subsites to the two addon domains, however, the main site in my multisite network I cannot easily edit/change. I would like to map the main site to primarySite.com, bypassing my original primary site.

Ideally or eventually, I’d like to remove the original single sites and either continue to redirect primarySite.com to primarySite.com/multisite or somehow move my subfolder network into the server root. However, what’s most important is that when I go to primarySite.com, I’m directed to the main site of my multisite network.

Note, it’s also important that I maintain the naming convention so I see primarySite.com, NOT primarySite.com/multisite

My wp-config for the multisite currently looks something like this:

define('DOMAIN_CURRENT_SITE', 'primarySite.com');
define('PATH_CURRENT_SITE', '/multisite /');

What is the best way to do this? I don’t really want to use a plugin or function. I’d prefer to edit something in .htaccess just not sure what that would look like or which .htaccess to edit, in the server root or multisite root.

Thanks a lot.

0
David Gaskin 4 months 0 Answers 8 views 0

Leave an answer