Project

General

Profile

Actions

Bug #15341

closed

tslib_fe->pageNotFoundHandler do not send 404 code

Added by old_hkdennis2k almost 19 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2005-12-31
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8.1
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)

Actions #1

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.

Actions #2

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';

Actions

Also available in: Atom PDF