Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#20385 closed defect (bug) (fixed)

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

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

Description

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

Change History (7)

#1 @markjaquith
14 years ago

  • Owner set to markjaquith
  • Resolutionfixed
  • Status newclosed

In [20397]:

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

#2 @batmoo
14 years ago

  • Cc batmoo@… added
  • Resolution fixed
  • Status closedreopened

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
14 years ago

  • Cc takashi@… added

#4 @markjaquith
14 years ago

  • Keywords needs-unit-tests added
  • Priority normalhigh
  • Severity normalblocker
  • Status reopenedaccepted
  • Version3.4

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

#5 @ryan
14 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
14 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
14 years ago

  • Keywords needs-unit-tests removed
  • Resolutionfixed
  • Status acceptedclosed

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.