Multisite, can’t recover origin subdomain site with navigation links
-
Hello, I already wrote similar topic, here I added some corrections. I have some issue with multisite sub domain links.
I have two case:
– first one in production: https://www.mysite.com with multisite format https://www.subdomain.mysite.com
– second one in pre-production: https://www.mysite.com with multisite format https://www.mysite.com/subdomain
And I use wordpress multisite functionality:
in prod: “SUBDOMAIN_INSTALL” => TRUE
in pre-prod “SUBDOMAIN_INSTALL” => FALSE
Navigation in my sites are some anchors (like some single page app). With one additional page ‘all projects’: https://www.mysite.com/subdomain/allprojects. Links to ‘all projects’ work correctly. When I navigate in my home page everything work correctly. But when I try to navigate from https://www.mysite.com/subdomain/allprojects it redirects me to https://www.mysite.com which is my main site. But I have to recover my subdomain site https://www.mysite.com/subdomain
Actually in pre-prod I fixed this problem in js/main.js with ‘/’ + window.location.href.split(‘/’)[3] + ‘/’ adding to this line of code: window.location.href = window.location.origin + ‘/’ + window.location.href.split(‘/’)[3] + ‘/’ + target;
For prod it should be almost the same solution with a minor correction.
But I think it is not a good practice. Should be some ‘wordpress’ solution. I spent a lot of time to find a solution with out success. May be some one have an idea what is wrong. Thank you
- The topic ‘Multisite, can’t recover origin subdomain site with navigation links’ is closed to new replies.