0

I have configured a multisite in order to use different subfolder for every site. I have started installing plugins on the network and while the installation works on the main site (https://mywebsite.com/stage/site1 ), nothing happens on the other site (https://mywebsite.com/stage/site2). It happen with theme installation too. It seems the installation are completely independent even if multisite is activated and the correct domain is defined.

What can be the reason of this behavior?

The following code has been used for wp-config.php

define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
define( 'DOMAIN_CURRENT_SITE', 'mywebsite.com' );
define( 'PATH_CURRENT_SITE', '/stage/site1/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

while this has been used for .htaccess

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /stage/site1/
RewriteRule ^index\.php$ - [L]
    
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
     
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

The website structure is:

https://mywebsite.com/stage/site1 (main website)

https://mywebsite.com/stage/site2 (secondary website)

Hope someone can help me to figure it out.

Thank you in advance!

7
  • Multisite installs already support subfolder/subdirectories for sites on the network without making additional special changes to HTAccess or wp-config.php
    – Tom J Nowell
    May 25 at 10:45
  • Hello @TomJNowell and thank you for the quick reply! I didn't make a particular configuration, I have only copied and pasted the .htaccess and wp-config.php snippets as provided by Wordpress. I would like to install and manage plugins for both sites (so if I activate a plugin via network, it should be installed on every site, as it should be). Do I need to modify the configuration?
    – Stefano
    May 25 at 10:52
  • Normally, you have a root site, e.g. /ABC and all sites are relative to that URL, your main site does not have to be your root site, it could just as easily be a site at /stage that redirects to a second or third. This is also assuming you've added the above in the correct location like any other wp-config.php adjustment. What I'm seeing though means that /stage/site2 can never work, especially with that HTAccess that explicitly references /stage/site1. /stage/site1/site2 might work with how you have set it up though
    – Tom J Nowell
    May 25 at 10:55
  • The /stage/ folder contains many other websites. I need a /stage/site1 to be the root site, which is need to be in network with /stage/site2. I would like to specify that /stage/site2 has a previous wp installation.
    – Stefano
    May 25 at 11:00
  • then what you're suggesting is not feasible as long as there are multiple installs, multisite lets you put multiple sites in 1 singular install of WordPress. If /stage/site2 already contains a copy of WordPress in that folder then that needs to be resolved first. You can't just overwrite it by adding a blog to a multisite in another folder and giving it that URL. This all sounds very messy, you should clean things up first. Why does stage/site1 need to be the root site? It sounds like you have requirements that are incompatible with each other
    – Tom J Nowell
    May 25 at 11:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.