I have some applications installed on subdomains and a wordpress multisite (that uses subdomains) on the main domain. Everything works fine, but with one issue: trying to access wpsub.example/app opens app.example (under the URL of wpsub.example/app) where wpsub is a site in wordpress multisite network and app is a subdomain that contains an application.
What I want (and think is more logical) is that accessing wpsub.example/app will open wpsub.example (like trying to access a non-existing folder in a website).
Are there other ways to do this than .htaccess redirect rules which require a list of all application subdomains?
I have some applications installed on subdomains and a wordpress multisite (that uses subdomains) on the main domain. Everything works fine, but with one issue: trying to access wpsub.example/app opens app.example (under the URL of wpsub.example/app) where wpsub is a site in wordpress multisite network and app is a subdomain that contains an application.
What I want (and think is more logical) is that accessing wpsub.example/app will open wpsub.example (like trying to access a non-existing folder in a website).
Are there other ways to do this than .htaccess redirect rules which require a list of all application subdomains?
It sounds complicated, and I am not sure I fully understand your setup. However, I dealt with the same general idea by putting the WordPress core two levels down (not one, but two). This then frees up the root for other things. .htaccess can be used to direct where the incoming URL for the main site goes. For example in the last line of the WordPress rewrite rule set, the /index.php
can be changed to /1/index.php
, if that is where the main site content lives.
There is more to it, but essentially the idea was to put the WordPress core two levels down, in its own dedicated directory, and then to put {wp-content} as its peer as a top level directory. This makes quite a difference already, and may help prevent subdomains or other or other applications from conflicting with the main WordPress core files.