Make WordPress Core

Opened 21 months ago

Last modified 11 months ago

#56359 new defect (bug)

Non-existent URLs show contents of homepage instead of 404 error

Reported by: softrain's profile softrain Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.0
Component: Permalinks Keywords: 2nd-opinion
Focuses: Cc:

Description

In a fresh install of WordPress, I noticed that non-existent URLs would show the contents of the homepage instead of returning 404 Not Found. For example, when WordPress is configured to use the “Plain” permalink structure (which is the default), going to http://example.com/does-not-exist/ would display the homepage instead of returning 404. The only time a 404 might be shown is when trying to access a post by its ID. For example, http://example.com/?p=9999. Is there something wrong with the “Plain” permalink setting that causes it to display the contents of the homepage instead of returning 404?

Change History (2)

#1 @ironprogrammer
21 months ago

  • Keywords 2nd-opinion added

Welcome to Trac, @softrain, and thank you for your report!

I'm able to reproduce this, and note that this isn't ideal for SEO (every "fake" URL becomes an indexible resource, and might be subject to SEO spam and de-ranking "attacks"). But I'm unsure whether this is working as designed, as odd as that may seem.

For context, the permalinks "Plain" setting is not SEO optimized, and may allude to situations like this. I've always used the other permalink structures, so don't know how long this behavior has been around 😅

Adding 2nd-opinion and CCing @SergeyBiryukov to hopefully get additional input.

#2 @SergeyBiryukov
11 months ago

#58353 was marked as a duplicate.

Note: See TracTickets for help on using tickets.