[wp-trac] [WordPress Trac] #19772: Nested install writes htaccess to web root instead of WP Site base

WordPress Trac wp-trac at lists.automattic.com
Sat Jan 7 20:29:44 UTC 2012


#19772: Nested install writes htaccess to web root instead of WP Site base
--------------------------+-----------------------------
 Reporter:  grapepress    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.3.1
 Severity:  normal        |   Keywords:  2nd-opinion
--------------------------+-----------------------------
 Greetings,

 I've run into an issue that seems to me to be a bug. If it is not a bug
 then my apologies and I would respectfully request it be considered for a
 future enhancement. I have searched the Trac and did not see anything that
 matches this problem exactly.

 I also took a look at [http://core.trac.wordpress.org/browser/branches/3.3
 /wp-includes/rewrite.php rewrite.php] but am not familiar enough with the
 core to pinpoint what I think should be different. I ''think'' some of the
 pertinent pieces are in ''class WP_Rewrite'', possibly involving the
 variables ''$front'' and ''$root'' (''$root'' seems the most pertinent of
 the two).


 '''Expected Behavior:'''[[BR]]
 That installing WP to "example.com/cms-beta/cms" with a Site Address of
 "example.com/cms-beta" and configuring Permalinks would result in the
 .htaccess file being written to "example.com/cms-beta/.htaccess".

 '''Observed Behavior:'''[[BR]]
 The .htaccess file is consistently written to "example.com/.htaccess"
 instead.

 Apache version: 2.2.19[[BR]]
 PHP Version: 5.2.17[[BR]]
 MySQL version: 5.1.52-cll


 I currently have 2 WP installs:

 -Main site:[[BR]]
 WordPress Address (URL): example.com/cms[[BR]]
 Site Address (URL): example.com

 -Beta site (this is where I am observing the problem):[[BR]]
 WordPress Address (URL): example.com/cms-beta/cms[[BR]]
 Site Address (URL): example.com/cms-beta

 For each I followed the instructions in the Codex regarding giving WP its
 own directory.

 The problem that I am running into is that when I update the permalinks
 for the Beta site it is writing to the htaccess file located at
 example.com as opposed to writing the htaccess file located at example.com
 /cms-beta which is what I would expect it to do. The consequence of this
 is that the Main site gets taken over by the Beta site.

 I tried moving the Beta site a level deeper to:[[BR]]
 WordPress Address (URL): example.com/cms-beta/wpbeta/cms[[BR]]
 Site Address (URL): example.com/cms-beta/wpbeta

 But again the Beta install is writing to the htaccess file all the way in
 the web root (at example.com) and not to example.com/cms-beta/wpbeta.

 I have, of course, tried disabling all plugins as well as just using the
 default theme.

 My expectation (unless I am missing something, which is always possible)
 is that WP should just use the Site Address variable to determine where it
 writes the htaccess file to, but that doesn't seem to be the case.

 Thank you in advance to those who review this. [[BR]]
 :-)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19772>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list