Site error handling: Show content from page with / entry point
The option "Show Content from Page" in the Site Configuration does not work if the "Entry point" is set to "/" instead of "https://www.mydomain/".
(Version: TYPO3 9.4.0)
#2 Updated by Martin Reimund 10 months ago
- PHP Version set to 7.2
Problem also appears in TYPO3 CMS v9.5.
It occurs in frontend and brings you to a white empty page once you have configured an error handler with the option "Show content from page" and specified a typo3 page as result of the error handler. Use an external link as result of an error handler basically works only as long you pass a protocol and hostname.
How have I produced this?
I have configured an error handler in the backend site management module "sites" for the case that a typo3 page is not found (http status code 404). I have used the option "Show content from page" (field "How to handle errors") and specified a typo3 page (typo link) in the field "Show Content From Page" as result of the error handler. As soon a frontend page request leads to a "page not found" (http status code 404), it tries to show the specified page, but the result is a white empty page instead of the specified one though.
I have taken a look into it and dove through the code to find out what causes the problem. It seems like the underlying cause is the class "PageContentErrorHandler". This page error handler uses the resource fetching method "GeneralUtility::getUrl". In this certain case the method gets passed a path without protocol and hostname, but it seems like this method requires this both fragments to be passed though.