Make WordPress Core

Opened 9 years ago

Last modified 4 years ago

#30784 new defect (bug)

Subsites won't show 404 with default permalink structure

Reported by: danhgilmore's profile danhgilmore Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: needs-patch
Focuses: multisite Cc:


On my Multisite (subfolder) installation, I have every site set to use the default (ugly) permalinks. If I go to a subsite and add extra invalid characters after the site name, it displays the site, not a 404 error page.

Example: If I type in domain.tld/sitename/EXTRACHARS it displays the content from domain.tld/sitename, yet keeps the /EXTRACHARS in all the links.

I spoke with Andrea Rennick and she said that this happens because WordPress ignores anything after the sitename because pretty permalinks are not enabled.

This all came up because our Google appliances were crawling millions of invalid URLs because .tld/sitename/EXTRACHARS returns a 200, instead of a 404.

Would it be possible to make it so that an invalid URL would return a 404 instead of ignoring characters beyond the sitename when permalinks are set to default?

Change History (4)

This ticket was mentioned in Slack in #forums by danhgilmore. View the logs.

9 years ago

This ticket was mentioned in Slack in #forums by danhgilmore. View the logs.

9 years ago

#3 @Ipstenu
9 years ago

When tested on a single site, I properly got a messy 404 (and a 'Hey, no 404.html stuff found'). I suspect this is related to the work done to allow for dynamic/ad-hoc sitenames (subdomains, subfolders, mapped domains, and networks) in WP.

#4 @earnjam
4 years ago

  • Keywords needs-patch added
  • Milestone set to Future Release
  • Type changed from enhancement to defect (bug)
  • Version 4.0.1 deleted

I've run into this one before. I just tested this on a brand new subdirectory multisite installation and confirmed it's still an issue.

Might be tricky to solve, but something we should look into because of the SEO implications (even though you'd already be taking an SEO hit by not using pretty permalinks). But independent of that, it's also just confusing for visitors.

Note: See TracTickets for help on using tickets.