Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#19772 closed defect (bug) (duplicate)

Nested install writes htaccess to web root instead of WP Site base

Reported by: grapepress's profile grapepress Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Rewrite Rules Keywords: 2nd-opinion
Focuses: Cc:

Description

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 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:
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:
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:

-Main site:
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.
:-)

Change History (3)

#1 @grapepress
13 years ago

  • Component changed from General to Rewrite Rules

#2 follow-up: @dd32
13 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This sounds like the recently fixed #18768 / [19697] - I'm closing as a duplicate of that, but can you just verify if that single character fix works for you?

#3 in reply to: ↑ 2 @grapepress
13 years ago

Replying to dd32:

This sounds like the recently fixed #18768 / [19697] - I'm closing as a duplicate of that, but can you just verify if that single character fix works for you?

Yes! That fixes it! I had seen that other ticket, but was not able to discern that it was the same underlying issue. Thank you for lending your expertise and spotting the overlap.

I'm so glad to have this fixed. And I'm even more glad to have confirmed that what I was expecting is what should have been happening.

Thank you again[[BR]]
:-)

Note: See TracTickets for help on using tickets.