Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#20385 closed defect (bug) (fixed)

/2012/03/individual-post/?page=2 canonical redirects not properly handled

Reported by: markjaquith's profile markjaquith Owned by: markjaquith's profile markjaquith
Milestone: 3.4 Priority: high
Severity: blocker Version: 3.4
Component: Canonical Keywords:
Focuses: Cc:

Description

Multipage posts don't have their ?page=X parameter properly redirected to a /X/ URL.

Change History (7)

#1 @markjaquith
12 years ago

  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In [20397]:

Properly handle paged permalink URLs even when we are not already 301ing. fixes #20385

#2 @batmoo
12 years ago

  • Cc batmoo@… added
  • Resolution fixed deleted
  • Status changed from closed to reopened

This breaks pagination on sites with static front pages: http://example.com/page/2/ gets redirected to http://example.com/2/

Adding a front page check seems to fix that:

if ( is_singular() && ! is_front_page() && get_query_var('page') ) {

#3 @iamtakashi
12 years ago

  • Cc takashi@… added

#4 @markjaquith
12 years ago

  • Keywords needs-unit-tests added
  • Priority changed from normal to high
  • Severity changed from normal to blocker
  • Status changed from reopened to accepted
  • Version set to 3.4

I'll work on this tonight. Needs unit tests!

#5 @ryan
12 years ago

In [20444]:

Don't do a canonical redirect for singular paged pages when on the front-page. This was breaking pagination on sites with a static home page. Props batmoo. see #20385

#6 @markjaquith
12 years ago

Okay, I tried. But our canonical redirect unit tests appear to be fundamentally broken. They simulate an HTTP request. Poorly. I couldn't get the test to fail, even at [20443].

#7 @markjaquith
12 years ago

  • Keywords needs-unit-tests removed
  • Resolution set to fixed
  • Status changed from accepted to closed

Sigh. Nevermind. Figured it out. Stupid typo. Made a unit test for it. The fix is good.

http://unit-tests.trac.wordpress.org/changeset/669/

Note: See TracTickets for help on using tickets.