Subdomain multi-site setup in a subdirectory

I have a scenario where I was hosting multiple single site installations. On my virtual private server, I have several subdirectories... mydomain.com/site1, mydomain.com/site2, where the clients domains are pointing to those subdirectories, i.e. clientsdomain1.com = mydomain.com/site1, clientsdomain2.com = mydomain.com/site2, etc. All those work perfectly. My domain itself didn't have a functioning site at it. I decided to set it up and get it working, but I didn't want it in the root folder, so I set it up at /wordpress. I installed Wordpress, database, theme, etc. and got it all working perfectly. Then I converted it to Multi-site.

When I initially did it, it was working (must have been cached). But now it does not. Strangely, I am able to get to wp-admin, I can navigate the dashboard, but I cannot navigate the site. When I go to mydomain.com/wp-admin, it automatically redirects to mydomain.com/wordpress/wp-admin. I'm sure it has to do with .htaccess settings or wp-config settings.

Keep in mind, the other subdirectory single install sites must continue to work as before. This new install is designed to be a subdomain multisite, where the subdomains, newclient1.mydomain.com, newclient2.mydomain.com will have their domain names pointing there and functioning as individual sites. (newclient1.com, newclient2.com, etc.)

Current .htaccess in public_html (root /) ((after messing around with it from reading articles)

RewriteEngine On
RewriteBase /wordpress  (*Note I originally had this as just  /)
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) wordpress/$1 [L]
RewriteRule ^(.*\.php)$ wordpress/$1 [L]
RewriteRule . index.php [L]

.htaccess in public_html/wordpress:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) wordpress/$1 [L]
RewriteRule ^(.*\.php)$ wordpress/$1 [L]
RewriteRule . index.php [L]

bottom section of wp-config in /wordpress:

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * <a title=obito href=/profile/link>obito</a> https://codex.wordpress.org/Debugging_in_WordPress
 */
define('WP_DEBUG', false);

/* ============== MULTI-SITE SETUP ================
 *
 */
define( 'WP_ALLOW_MULTISITE', true );

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'MYDOMAIN.COM');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

/* That's all, stop editing! Happy blogging. */

I suppose if it would be easy to change, I could move the main site to root. I kind of wanted to keep it separate. My plan is to add the plugins for WHMCS.

Wordpress Version: 4.6.1
*Edit - While I'm able to get to the Site Dashboard, if I click on Network Admin>Dashboard, I get 500 error.

  • Adam Czajczyk

    Hello Fred,

    I hope you're well today and thank you for your question!

    This is a complex issue and I'm afraid the solution here is to move your Multisite to the root folder.

    The Multisite can work in two modes (but not at once): as a sub-domain or sub-folder install. If WordPress is installed in a root folder of the main domain it can support both of these setups, depending of your choice so the sub-sites can be either like "sub.domain.com" or "domain.com/sub".

    If WordPress itself is installed in a subfolder of the main domain, it only supports the "sub-folder" install so the sub-sites would be "domain.com/mainsite/subsite".

    That means that if you wish to keep it in a subfolder as it is now, you would want to turn it to a sub-folder instead of sub-domain install. If you however wish to keep it as sub-domain install you would want to move it to the root folder of your domain.

    If you have any further questions, let me know please.

    Best regards,
    Adam

  • Fred

    Ok, I made the change. All is well now. The primary site is in root and it works fine.

    Next, I have questions and need help with Pro Sites. When I'm not logged in, there are no options, it appears as though only people with an existing membership can 'upgrade' their plan.

    I want users to be able to visit the site, see the plans, choose a plan, check out and pay, and then create their site... newclient.mydomain.net and then when they point their DNS to it, it starts working under their domain. During the setup process, I would also like them to be able to pick a theme, 3 or 4 that I will allow them to choose from, and go on from there. Is that possible?

    Should I start a new thread for that?

    Thanks!

    -Fred

  • Dimitris

    Hey there Fred,

    hope you're doing good today and don't mind me jumping in here, I'm really glad that you sorted out the new multisite installation!

    Should I start a new thread for that?

    As we try to keep threads related to specific members and issues, I'd rather advise you to start a new thread for each issue you encounter.
    https://premium.wpmudev.org/forums/#question
    https://premium.wpmudev.org/manuals/using-wpmu-dev/the-good-support-ticket/
    Having said that, I'll try to answer your questions in case these can be easily resolved. :slight_smile:

    Next, I have questions and need help with Pro Sites. When I'm not logged in, there are no options, it appears as though only people with an existing membership can 'upgrade' their plan.

    Have you set the registration to "Both sites and user accounts can be registered." in Network admin -> Network Settings -> Allow new registrations?

    I want users to be able to visit the site, see the plans, choose a plan, check out and pay, and then create their site... newclient.mydomain.net and then when they point their DNS to it, it starts working under their domain. During the setup process, I would also like them to be able to pick a theme, 3 or 4 that I will allow them to choose from, and go on from there. Is that possible?

    For this kind of setup you will definitely need Pro Sites (and maybe the eNom integration to provide domain names to your clients) and the New Blog Template plugin to provide some themes upon a new site registration.

    Kind regards,
    Dimitris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.