Bug #15341
closedtslib_fe->pageNotFoundHandler do not send 404 code
0%
Description
by default,
TSFE do send a "Status: 404 Not Found"
But it will send http code 200(OK) to respnose in Apache httpd.
You may found some people said change the $TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader'] to "HTTP/1.0 404 Not Found"
But reference to php.net document(http://www.php.net/header),
it should be using
header ( string string [, bool replace [, int http_response_code]] ) since php 4.3.
It is available in PHP 4.3.0 and higher, and it is the minium requirement of typo3.
replace
header($header);
with
header($header, true, 404); // This is pageNotFoundHandler, it should be always 404.
(issue imported from #M2145)
Updated by old_hkdennis2k almost 19 years ago
When using FastCGI
header('Status: ....', true, 404); will has error "duplicate header 'Status'".
(is it a bug of PHP?)
"Status: " is a standard in CGI, but mod_php will ignore it.
Updated by Michael Stucki over 18 years ago
Fixed in TYPO3 4.0.
To enable the 404 header, set option below in typo3conf/localconf.php:
$TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = '1';