Sub-subdomain getting redirected to main domain

I’m working on a multisite network.

I intend to make it a subdomain based network but cant seem to make it work because of the redirects.
The main multisite network resides under app.trainergoesonline.com

So subsequent sites should go under site1.app.trainergoesonline.com, site2.app.trainergoesonline.com and so on.
So far any installation I’ve done, I havent been able to access them as they keep redirecting to the root domain “trainergoesonline.com”

Following are the lines i included in the wp-config.php

define( 'WP_ALLOW_MULTISITE', true );
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', true );
define( 'DOMAIN_CURRENT_SITE', 'app.trainergoesonline.com' );
define( 'PATH_CURRENT_SITE', "https://wordpress.stackexchange.com/" );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

And following are the .htaccess rules for wordpress [all boilerplate]

# BEGIN WordPress
<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteRule ^index\.php$ - [L]

 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]
</IfModule>
# END WordPress

I’ve looked far and wide across the internet but unable to find any valid direction to solve this redirection issue.

A couple of sites i tried to create are test2.trainergoesonline.com test10.trainergoesonline.com
They all get redirected to the root domain

I look at this community with great hope!

0

Leave a Comment