Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#17114 closed defect (bug) (duplicate)

Blog URLs need canonical redirect functionality similar to post URLs

Reported by: amattie's profile amattie Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: General Keywords:
Focuses: Cc:


Take a look at these two URLs:

The first URL loads up the Amsterdam blog home while the second URL loads up a post on the Amsterdam blog that starts with the word "amsterdam." The reason for this is because WordPress currently uses a case-sensitive match on line 164 in class-wp.php. Since a case-sensitive match of a form of home_url() isn't found in the requested path, the request URL is never set up right. redirect_guess_404_permalink() ultimately ends up redirecting the request in this case.

Changing the regex match to be a case-insensitive match on that line fixes the problem, but it also allows that blog to then be loaded from multiple URLs. Breaking canonical URLs like that would be bad obviously.

It seems that functionality needs to be added to not only handle the canonical URLs for pages / posts, but also for blogs. I'm not familiar enough with that code to attempt a fix, but I wanted to bring it up anyway as this seems unintended.

Change History (4)

#2 @amattie
12 years ago

Yep, but I'm wondering if it should be that way when a blog name overlaps with a post name that's found by redirect_guess_404_permalink. It just seems like it might be an unintended consequence within that functionality.

#3 @nacin
12 years ago

  • Version set to 3.0

#4 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.