Symfony version(s) affected: ^5.1.9
Description
#38614 introduce a BC when using URL rewriting and that the URI contains the same string as the subdomain.
How to reproduce
- Setup URL rewriting from
domain.com/index.php/api to api.domain.com
- Add a route containing
/api/ (for example @Route("/foo/api/bar"))
- Go to
api.domain.com/foo/api/bar, you will have a 404
Possible Solution
Change the if in the PR to not change $basename when the URI contains the subdomain where strpos !== 0, basically revert the PR.