Make WordPress Core

Opened 7 years ago

Last modified 6 weeks ago

#41128 new defect (bug)

404 Page not found after using same URL in post / page

Reported by: jpgos's profile jpgos Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

Starting from a clean Wordpress 4.8 installation.

  1. Configure permalinks to: http://domain.com/post-title/
  2. Create a post with title 'new'
  3. Remove the post with title 'new' to trash
  4. Create a new page with title 'new'
  5. Remove post 'new' from trash (not necessarily, both cases result in 404)
  6. The page you created trows a 404 due to a database error since it has two different objects with the same URL, though different objects.

Change History (2)

#1 @SergeyBiryukov
7 years ago

  • Component changed from Database to Posts, Post Types

#2 @niclovincent
6 weeks ago

First, ensure that the post with the conflicting slug ('new') has been permanently deleted from the trash. Even though it's in the trash, it can still conflict with the page.

Edit the page titled 'new' and change its slug to something unique. You can do this by editing the page and modifying the permalink settings (usually located below the page title field).

After changing the page slug, it's a good idea to update your permalinks to refresh the rewrite rules. Go to Settings > Permalinks in your WordPress admin dashboard, and simply click the "Save Changes" button without making any changes. This will flush and regenerate the permalink structure.

Once you've completed the above steps, visit the page with the updated slug ('new' or whatever you changed it to) to ensure that it now loads correctly without a 404 error.

Note: See TracTickets for help on using tickets.