WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#29829 closed feature request (duplicate)

Handling other HTTP header returns, rather than solely 404.

Reported by: rhyswynne Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Query Keywords: 2nd-opinion
Focuses: Cc:

Description

It would be nice to return more HTTP Status codes rather than just 404.

For example, Privately Published posts should probably return a 403 Code - http://en.wikipedia.org/wiki/HTTP_403, rather than a 404.

Would be nice to have a set_header('code') & is_header('code'), so we could have more control for what pages can show up if need be.

Change History (4)

#2 in reply to: ↑ description @helen
6 years ago

Replying to rhyswynne:

For example, Privately Published posts should probably return a 403 Code - http://en.wikipedia.org/wiki/HTTP_403, rather than a 404.

I disagree with this specifically - privately published posts should not be "known" to anybody who shouldn't have access. Returning a 403 instead of 404 would make it known.

#3 @johnbillion
6 years ago

  • Component changed from General to Query
  • Keywords 2nd-opinion added
  • Version trunk deleted

#4 @rachelbaker
5 years ago

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

After #10551 wp_die() does support a parameter for the HTTP response code (r30355) and returns 403 for permission check failures (r30356). Closing this ticket as a duplicate, since the feedback above goes against the "nice to have" scope addition of:

Privately Published posts should probably return a 403 Code

Note: See TracTickets for help on using tickets.