|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45818 Header location not work in 404 error page with Nginx
Submitted: 2008-08-14 08:56 UTC Modified: 2008-08-22 01:00 UTC
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: macroz at gmail dot com Assigned:
Status: No Feedback Package: CGI/CLI related
PHP Version: 5.2.6 OS: centos 5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: macroz at gmail dot com
New email:
PHP Version: OS:


 [2008-08-14 08:56 UTC] macroz at gmail dot com
Code header(Location:url) in 404 error page not work with nginx.

My webserver is Nginx 0.7.10 + php-fastcgi 5.2.6

Nginx conf code: 

error_page  404  /404.php;

Code in 404.php:

header("HTTP/1.1 301 Moved Permanently");

Curl -I a not exists file results (Nginx 0.7.10 + php-fastcgi 5.2.6)

curl -I
HTTP/1.1 404 Not Found
Server: nginx/0.7.10
Date: Thu, 14 Aug 2008 08:46:45 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: PHP/5.2.6

This is work in apache+mod_php.
Curl -I a not exists file results (apache + mod_php)

curl -I
HTTP/1.1 301 Moved Permanently
Date: Thu, 14 Aug 2008 09:08:41 GMT
Server: Apache
X-Powered-By: PHP/5.2.5
Vary: Accept-Encoding
Connection: close
Content-Type: text/html

Reproduce code:
header("HTTP/1.1 301 Moved Permanently");

Expected result:
It will be location to when visite a not exist page.

Actual result:
Not location to


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-22 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 13 23:01:32 2024 UTC