Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#40836 closed defect (bug) (invalid)

add_rewrite_endpoint() creates sub directories after endpoint

Reported by: henrywright's profile henry.wright Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Rewrite Rules Keywords:
Focuses: Cc:


Adding an endpoint with add_rewrite_endpoint() seems to also create sub directories after that endpoint. For example:

// Add query var.
add_filter( 'query_vars', function( $vars ) {
    $vars[] = 'my-endpoint';
    return $vars;
} );

// Add endpoint.
add_action( 'init', function() {
    add_rewrite_endpoint( 'my-endpoint', EP_AUTHORS );
} );

I can now visit:


Is this expected?

I believe the following should return a 404:


Change History (2)

#1 @henry.wright
7 years ago

  • Resolution set to invalid
  • Status changed from new to closed

After researching this issue some more I see this is how add_rewrite_endpoint() is intended to work.

Anything after my-endpoint/ is matched by the rewrite rule and is therefore used in the query string.


#2 @SergeyBiryukov
7 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.