WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#22210 closed defect (bug) (duplicate)

Permalink 404 when re-using trashed page's permalink

Reported by: Clorith Owned by:
Milestone: Priority: normal
Severity: major Version: 3.4.2
Component: Permalinks Keywords:
Focuses: Cc:

Description

When creating a post with the same permalink as a page that has been trashed (not permanently deleted) the page will 404 presuming the page to be non-existant.

This does not take into account which post/page was created first, if there is a trashed page it will 404.

Can be replicated as follows:

  • Create a page with any title
  • Publish the page
  • Move the page to trash (do not permanently delete the page)
  • Create a new post with the same title
  • Publish the post and try viewing it

When permanently deleting the page this is no longer an issue, also the title can be anything as long as the permalink is identical to the trashed article.

This was brought up in #19333 with version 3.2.1 as well, but appears to have been related to a misconfigured htaccess file/webserver at the time.

Attachments (1)

22210.diff (812 bytes) - added by kovshenin 2 years ago.
Check the page post status before verifying a match

Download all attachments as: .zip

Change History (5)

comment:1 @kovshenin2 years ago

I couldn't reproduce this until I switched my permalink settings to /%postname%/.

comment:2 @Clorith2 years ago

Yes, I am using /%postname%/ as well.

comment:3 @SergeyBiryukov2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #21970.

@kovshenin2 years ago

Check the page post status before verifying a match

comment:4 @kovshenin2 years ago

@SergeyBiryukov is way too fast :) will upload my patch to the other ticket.

Note: See TracTickets for help on using tickets.