Issue Bug Closed

#65801Headers are visible if URI of pageNotFound_handling has a redirect by .haccess

Stefan Froemken 03/18/15, 11:26 updated 04/15/19, 09:00

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

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.