-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Route not found when URIs contains subdomain (virtualhosts) #39882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't think there is an easy way to have both behaviors. This previous data used to pass (if you add it in [
'/foo/api/bar',
[
'SCRIPT_FILENAME' => '/home/user/public_html/api/index.php',
'SCRIPT_NAME' => '/api/index.php',
'PHP_SELF' => '/api/index.php',
],
'',
'/foo/api/bar',
], and since the PR it doesn't, the current workaround is simply to extends the Request and revert the |
It is always a guess. I think we should add support to some specific enviroment variable which webserver can set. As discussed in #38614, the standard server enviroment variables are not enough. |
…ressions (BafS) This PR was merged into the 4.4 branch. Discussion ---------- [HttpFoundation] Revert #38614 and add assert to avoid regressions | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #39882 | License | MIT #38614 introduced a BC, this PR revert the PR, update tests and add an assert to avoid regressions. Commits ------- 3058cd0 Revert #38614, add assert to avoid regression
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
domain.com/index.php/api
toapi.domain.com
/api/
(for example@Route("/foo/api/bar")
)api.domain.com/foo/api/bar
, you will have a 404Possible Solution
Change the if in the PR to not change
$basename
when the URI contains the subdomain wherestrpos !== 0
, basically revert the PR.The text was updated successfully, but these errors were encountered: