Bug #65801
closedHeaders are visible if URI of pageNotFound_handling has a redirect by .haccess
100%
Description
Hello,
in Installtool of domain1 we have configured:
[FE][pageNotFound_handling] = http://domain2/notFound.html
In Server with domain2 we have an .htaccess entry which redirects all calls to HTTP automatically to HTTPS
If you now try to show f.e. a Sysfolder in Frontend then a 404 page was shown, but on top you see a header like:
HTTP/1.1 200 OK Date: Mon, 16 Mar 2015 08:35:09 GMT Server: Apache Last-Modified: Tue, 26 Aug 2014 10:32:44 GMT Accept-Ranges: bytes Content-Length: 283 Cache-Control: max-age=1800 Expires: Mon, 16 Mar 2015 09:05:09 GMT Content-Type: text/html
If I change [FE][pageNotFound_handling] to an HTTPS uri everything works like excepted.
The problem appears in TypoScriptFrontendController->pageErrorHandler
$res = GeneralUtility::getUrl($code, 1, $headerArr); // Header and content are separated by an empty line list($header, $content) = explode(CRLF . CRLF, $res, 2);
Here is only a check for the first header data which is in our case the redirect. So the 200 OK Status Header was moved into the content area.
Stefan
Updated by Simon Schaufelberger over 7 years ago
Here is a snippet somebody sent to me. Maybe thats helpful.
$res = GeneralUtility::getUrl($code, 1, $headerArr); // Header and content are separated by an empty line list($header, $content) = explode(CRLF . CRLF, $res, 2); if (substr($content, 0, 4) == 'HTTP') { list($header, $content) = explode(CRLF . CRLF, $content, 2); } $content .= CRLF;
Updated by Riccardo De Contardi almost 6 years ago
Can this issue be considered still valid? If I have not understood it wrong, TypoScriptFrontendController->pageErrorHandler
has been deprecated since version 9.2 and removed on 10
See
typo3/sysext/core/Documentation/Changelog/9.2/Deprecation-83883-PageNotFoundAndErrorHandlingInFrontend.rst
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst
Updated by Stefan Froemken almost 6 years ago
- Status changed from New to Closed
You're right. With a redirect or static string in pageNotFound Handling of a TYPO3 8 to a non https URI, but with redirect to https, of a TYPO3 9 there are no header data visible anymore. Perfect. Ticket can be closed.