Two multisites, One domain
-
I want to create two multisites that use subdomains but use the same domain. I want them separate instances for security and other reasons.
I installed a multisite with subdomains to my site stocklighting.com. I have set a wildcard subdomain and everything works great for that multisite instance. I installed a second multisite with subdomains in the folder stocklighitng.com/private.
I then created two subdomains for each multisite.
primary:
sub1.stocklighitng.com, sub2.stocklighting.com,
private:
sub3.stocklighting.com, sub3.stocklighting.comThe mulitisite in private lets me create a subdomain site just fine the only issue is it appends the root folder name to the end of the url which in this case is /private.
sub3.stocklighting.com/private and sub4.stocklighting.com/privatewhat I want to do is hide the /private so it doesn’t show in the url I’ve played around with the htaccess on both sites and can’t get it to work.
This is the htaccess for the Mulitisite install in the root directory
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]# END WordPress
This is the htaccess for the multisite installed in the /private directory
# BEGIN 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).*) private/$1 [L]
RewriteRule ^(.*\.php)$ private/$1 [L]
RewriteRule . index.php [L]# END WordPress
Does anyone who know server and apache rewrites better than I do have any advice on how I can get this structure to work? Like I said it works, but if I remove the subfolder extension from any site on my second multisite it resolves to the first one and it thinks I’m trying to register a new site.
The topic ‘Two multisites, One domain’ is closed to new replies.