Loading the WP environment in a (non-blog) subdomain
-
I have a subfolder install of WP multisite, let’s say at “domain.com”.
I now need to load the WP environment in subdomains of domain.com, say “sub1.domain.com”, “sub2.domain.com”, … “subN.domain.com”. Note that these subdomains do not correspond to WP blogs. But I do need to have access to the logged in user, the database, etc.
I have set up wildcard subdomains to load a php file that will display what I need for any particular subdomain, and I am including “wp-load.php” early in that file. The problem is that near line 99 in “ms-settings.php” it redirects to the main page of the site because $_SERVER[ ‘HTTP_HOST’ ] is the subdomain, not the main site domain.
So how can I load the WP environment correctly in a non-blog subdomain?
Do I need to somehow correctly set up the $current_site and $current_blog globals manually? Or is this something to do with the SUNRISE constant?
I’m a bit lost, so any pointers would be much appreciated.
- The topic ‘Loading the WP environment in a (non-blog) subdomain’ is closed to new replies.