Skip to content

[HttpFoundation] Route not found when URIs contains subdomain (virtualhosts) #39882

Closed
@BafS

Description

@BafS

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

  1. Setup URL rewriting from domain.com/index.php/api to api.domain.com
  2. Add a route containing /api/ (for example @Route("/foo/api/bar"))
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions