WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#13561 closed defect (bug) (fixed)

Canonical redirect not firing properly for ?p=# with custom post types

Reported by: nacin Owned by: markjaquith
Milestone: 3.0 Priority: normal
Severity: blocker Version:
Component: Canonical Keywords:
Focuses: Cc:

Description

If the blog's permalinks are ugly, then ?p=# will not redirect to ?p=#&post_type=ptype (404). This is without regard to the rewrite setting on the post type.

If the blog's permalinks are pretty:

If rewrite => true on the post type, then ?p=# will redirect properly. However, `?p=#&post_type=ptype will cause post_type=ptype to be appended to the final pretty custom post type URL.

If rewrite => false on the post type, then ?p=# will not redirect (404). Also, p=#&post_type=ptype will redirect to p=#&post_type=ptype&post_type=ptype.

I imagine all of this is the same bug, in that post_type is being appended again. This results in either an internal rewrite and thus the 404, or the external redirect and then you get doubled post_type parameters.

Attachments (1)

13561.diff (1.5 KB) - added by markjaquith 4 years ago.

Download all attachments as: .zip

Change History (2)

markjaquith4 years ago

comment:1 markjaquith4 years ago

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

(In [14954]) Properly redirect custom post type URLs in redirect_canonical(). fixes #13561

Note: See TracTickets for help on using tickets.