WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#12601 closed defect (bug) (fixed)

Post_type + non-existant object + Canonical

Reported by: dd32 Owned by: markjaquith
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Canonical Keywords: has-patch needs-testing
Focuses: Cc:

Description

Hit a page such as this: http://localhost/wordpress-commit/wiki/something and the canonical system kicks in and attempts a redirect to http://localhost/wordpress-commit/2010/02/13/something-i-want-to-keep-quiet/

The canonical system should reconise when a object being queried is a post_type and not redirect to a similar slug.

The same redirection will take place for the url http://localhost/wordpress-commit/apage/something - Once again, redirection from page -> post.

Attachments (2)

12601.diff (622 bytes) - added by dd32 5 years ago.
12601.2.diff (970 bytes) - added by dd32 5 years ago.

Download all attachments as: .zip

Change History (8)

@dd325 years ago

comment:1 @dd325 years ago

  • Keywords has-patch needs-testing added

attachment 12601.diff added

  • Limits to searching for posts in the same post_type if a post_type was specified in the original rewrite rule.
  • Does not apply to the Page -> Post redirection, Only to Custom Post Type -> Other Post type redirection

comment:2 @dd325 years ago

  • Keywords has-patch needs-testing removed

comment:3 @dd325 years ago

(In [13697]) Limit redirect_guess_404_permalink() to the same post_type if it's specified in the query. See #12601

@dd325 years ago

comment:4 @dd325 years ago

attachment 12601.2.diff added

  • Needs Testing.
  • If a request is for a Post (ie. /2008/12/somethi), then the 404 search will only look for posts with 'somethi%'
  • If a request if for a Page (ie. /somethi), then the 404 search will look at both pages AND posts

Its a step forward IMO, but still doesnt prevent page -> post redirects. It nearly seems like leaving that functionality present would be best, while avoiding the obviously incorrect redirects from post permalinks to pages.

comment:5 @dd325 years ago

  • Keywords has-patch needs-testing added

comment:6 @dd325 years ago

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

Closing this as fixed for 3.0, created #13041 to carry on the Page -> Post -> Page redirections.

Note: See TracTickets for help on using tickets.