WordPress.org

Make WordPress Core

Opened 13 days ago

#48223 new defect (bug)

parse_request(): When request has multiple matching rewrite rules, and matched rule returns 404 - iterate to next rewrite rule

Reported by: apedog Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:
PR Number:

Description

A request might have multiple matching rewrite rules.
parse_request() will take the top rule and attempt to parse it. If that rule results in an empty query, is_404() is set.

In the case of a 404 error on the first matched rule, parse_request() should iterate to the next matched rule and attempt the next query.

Example:
A request might match all these rules=>queries:

  1. (.?.+?)(?:/([0-9]+))?/?$ => pagename=$matches[1]&page=$matches[2]
  2. ([^/]+)(?:/([0-9]+))?/?$ => name=$matches[1]&page=$matches[2]

If first query pagename=$matches[1]&page=$matches[2] returns 404, parse_request() should attempt the second query before returning a 404 error.

Change History (0)

Note: See TracTickets for help on using tickets.