[wp-trac] [WordPress Trac] #22639: Multisite in a subdirectory suggests the wrong location for .htaccess

WordPress Trac noreply at wordpress.org
Mon Dec 3 01:54:36 UTC 2012


#22639: Multisite in a subdirectory suggests the wrong location for .htaccess
--------------------------+--------------------
 Reporter:  nacin         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.5
Component:  Multisite     |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by nacin):

 Consider this scenario:
  * I have my DOCUMENT_ROOT set to `/Users/nacin/Sites`
  * I have my WordPress install at `/Users/nacin/Sites/subdir-
 test/wordpress`. With /, this is ABSPATH.
  * The "siteurl" is http://localhost/subdir-test/wordpress`
  * The "home" URL is http://localhost/subdir-test

 In this situation, $wp_dir_from_root is `/subdir-test/wordpress/`. And
 then there's this:
 {{{
 $base = parse_url( $slashed_home, PHP_URL_PATH );
 }}}

 $base is then /subdir-test/. With that, we calculate $wp_siteurl_subdir,
 which removes $base from the start of $wp_dir_from_root, leaving you with
 `/wordpress/`.

 And finally, to calculate $home_path, we shouldn't use ABSPATH minus
 $wp_dir_from_root, but rather ABSPATH minus $wp_siteurl_subdir. This
 avoids us from chopping off too much.

 With .4.patch, I am told to go to `/Users/nacin/Sites`. The proper
 location is `/Users/nacin/Sites/subdir-test`.

 Obviously, we've all been away from this code for a few good months, so I
 figured I would offer this refresher. For sure, some of this should end up
 in code comments as we set these 7 different variables at the top of
 network_step2().

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/22639#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list