apache2.xml Add notes about FallbackResource#4580
Merged
Merged
Conversation
Contributor
Author
|
Is there anything I can do to help progress this issue? Thanks |
Contributor
Author
|
Hi folks, Just wondering if there's anything I can do to help progress this patch? |
lacatoire
approved these changes
Feb 2, 2026
Member
|
LGTM - Documents a real gotcha that affects many PHP developers using modern routing. Clear explanation with working solution. |
Contributor
Author
|
Hi folks, I'm still looking for a merge on this. This has now been noted on the Apache docs too:
@mmalferov I think you're the main contributor in this space. Are you able to review this or point me in the right direction? |
3c011a3 to
d6bc948
Compare
jordikroon
reviewed
Jul 3, 2026
Co-authored-by: Jordi Kroon <jordi@jordikroon.nl>
dba8cc1 to
fbf33c9
Compare
Member
|
Hi @andrewnicols. I am very sorry this has been on the shelf for so long. I have rebased your branch and fixed some minor style nits on your behalf. The changed look good to me. Thank you for your efforts. |
lacatoire
added a commit
to php/doc-fr
that referenced
this pull request
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I recently encountered an issue when configuring a
FallbackResourcefor Apache.We are in the process of migrating legacy paths to use a routing engine and as part of the migration we are providing a shim. As a result we have users hitting paths such as
/example.phpwhich are now expected to be handled by the Routing system.We discovered that our Apache2 test images were not hitting the Routing system for these paths and, after digging, that it's because the
SetHandlerandAddHandlerdirectives are set based on the path location rather than the file. That is, if the locationhttps://example.com/example.phpis requested then the<FilesMatch>directive is always applied based on the\.php$regex match. As a result, theFallbackResourcedirective is not applied (beceause a Handler has already been applied).This has previously been rejected as a bug in Apache2 as it is the expected behaviour.
I have:
Given that the
FallbackResourceis the recommended way to use a routing system such as Symfony it is probably worth documenting:FallbackResourcedirective; andIf -fdirective when setting the handler to only apply it when the requested file actually exists.