Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy