Nested install writes htaccess to web root instead of WP Site base
|Reported by:||grapepress||Owned by:|
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 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).
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".
The .htaccess file is consistently written to "example.com/.htaccess" instead.
Apache version: 2.2.19
PHP Version: 5.2.17
MySQL version: 5.1.52-cll
I currently have 2 WP installs:
WordPress Address (URL): example.com/cms
Site Address (URL): example.com
-Beta site (this is where I am observing the problem):
WordPress Address (URL): example.com/cms-beta/cms
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:
WordPress Address (URL): example.com/cms-beta/wpbeta/cms
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.