|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #20453 $_SERVER['QUERY_STRING'] not set on 404 redirect
Submitted: 2002-11-15 18:20 UTC Modified: 2003-01-19 15:50 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: clewis at myfonts dot com Assigned: philip (profile)
Status: Not a bug Package: Documentation problem
PHP Version: 4.2.3 OS: RedHat 7.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: clewis at myfonts dot com
New email:
PHP Version: OS:


 [2002-11-15 18:20 UTC] clewis at myfonts dot com
$_SERVER['QUERY_STRING'] is empty in our 404-handling script, which is displayed when the user's URL is not found.  The query string appears correctly in REQUEST_URI, so the data is there, it's just not getting into the QUERY_STRING var.

Here are some dumps of the $_SERVER array, for an existing script, and a bad URL that displays the 404 script:

(user: bugzilla; Pass: bugzz)

Using Apache 1.3.26, PHP 4.2.3, configured with
'./configure' '--prefix=/usr/local' '--with-apache=../apache' '--with-mysql=/usr/local' '--with-curl' '--with-gd' '--with-mcrypt' '--with-pspell' '--enable-apc' '--with-zlib'



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-16 01:51 UTC]
This is how Apache behaves. It doesn't set QUERY_STRING when
page is not found as it's redirected.

You can test this with putting phpinfo() into your 404 script. Search for "REDIRECT_QUERY_STRING" in the "Apache Environment" section..

(it's also in _SERVER var)

 [2002-11-18 01:18 UTC]
Am working on this.  There are several REDIRECT_* predefined vars to use.

See also:
 [2003-01-19 15:50 UTC]
This is actually part of an open phpdoc feature request made here:

Not every single possible predefined variable is documented, that's quite a job.  When/if it does happen, this information will exist within it :)
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Oct 22 01:03:33 2021 UTC