[wp-trac] [WordPress Trac] #27999: Problem with embedding WordPress Multisite in other PHP applications caused by path difference in ms-settings

WordPress Trac noreply at wordpress.org
Sun Sep 7 16:46:52 UTC 2014


#27999: Problem with embedding WordPress Multisite in other PHP applications caused
by path difference in ms-settings
-------------------------------------+------------------------------
 Reporter:  ivanbajalovic            |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Networks and Sites       |     Version:  3.9
 Severity:  major                    |  Resolution:
 Keywords:  reporter-feedback close  |     Focuses:  multisite
-------------------------------------+------------------------------

Comment (by alexfurr):

 FIXED!
 I'll post the problem / solution in full in case it helps anyone else.
 Thanks to all who aided me.

 '''The Problem'''
 Running custom php pages that are including the wp-blog-header.php break
 when upgrading to WP 3.9. This only occurs if you are running a multisite
 in a subfolder e.g. "www.mysite.com/sites/"

 '''The Solution'''
 1. Create (if not already exist) the sunrise.php page in the wp-content
 folder.
 2. Add define( 'SUNRISE', 'on' ); to the wp-config file
 3. Add the following code to the sunrise.php file:


 {{{
 if (strpos($_SERVER['REQUEST_URI'],'/sites') === false)
 {
 $_SERVER['REQUEST_URI'] = '/sites/';
 }
 }}}


 This way it only overrides the request_uri on NON wordpress pages, which
 enables you to load the wp-blog-header.php correctly and also prevents all
 regular WP pages from redirecting to the root.

 Hope that helps someone else.
 Alex

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27999#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list