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
wrong 404 page shown for URLs that have no suffix #1172
Comments
@contao/developers Do you think we should handle this case? URLs without the URL suffix are not valid Contao URLs and therefore Contao should not try to extract anything from them IMO. |
If it’s an easy fix, I think we should do it. |
I agree, it's not a Contao URL so why does it redirect to the English 404 page then? :D |
It does not redirect, it simply generates the 404 page of the primary |
What if I configured an empty URL suffix? |
Then such URLs would show the regular 404 page and URLs with an URL suffix possibly will not. |
Contao should only handle this kind of cases, when a route with a |
Which is true for any URL ;) routing.yml#L25-L33 # The catch all route must be the last one!
contao_catch_all:
path: /{_url_fragment}
defaults:
_scope: frontend
_token_check: true
_controller: "ContaoCoreBundle:Frontend:index"
requirements:
_url_fragment: .* |
|
Yes of course, but that's not the point. Any URL (that is not physically present or catched otherwise) is a valid Contao URL currently. |
Thats a problem, if somebody has a Symfony application and adds the |
Yes, but Contao URLs are currently only processed via the If you use the |
This is indeed an issue, we have to do something about it. It was completely confusing for me and I debugged quite a bit and didn't even remember that issue here :) So either the issue is that it does not find the correct 404 page to render or the issue is that it tries to render one even though it should not be considered a Contao request. |
As discussed in Mumble on February 15th, a first step to solving the problem would be to move this block core-bundle/src/Resources/contao/classes/Frontend.php Lines 99 to 121 in 483e7fe
before this block core-bundle/src/Resources/contao/classes/Frontend.php Lines 82 to 97 in 483e7fe
|
Fixed in fae22c6. |
This still happens in Contao 4.4.18. |
Still happening in Contao 4.4.26 & 4.6.6 |
Apparently, the change from fae22c6 is no longer there. It is actually not in the history, either. 🤔 Re-added in contao/contao@65b5d55. |
Tested with Contao 4.4.7.
Reproduction:
contao.url_suffix
at its default value (.html
).prepend_locale: true
, clear the cache.en
.de
.The first URL will show the German 404 page as expected.
The second URL will show the English 404 page, even though the URL clearly has the
/de
language fragment in it.As indicated with the first reproduction step, the language shown for such a URL depends on the
Accept-Language
of the request header actually. So if your browser is set to German, you can test with the following URLs instead:The first URL will show the English 404 page, the second one will show the German 404 page.
The text was updated successfully, but these errors were encountered: