[wp-trac] [WordPress Trac] #48223: parse_request(): When request has multiple matching rewrite rules, and matched rule returns 404 - iterate to next rewrite rule
WordPress Trac
noreply at wordpress.org
Sat Oct 5 14:34:31 UTC 2019
#48223: parse_request(): When request has multiple matching rewrite rules, and
matched rule returns 404 - iterate to next rewrite rule
--------------------------+-----------------------------
Reporter: apedog | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48223>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list