php.net |  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
Votes:1
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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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)

http://clewis.myfonts.com/exists.php?stuff=things
http://clewis.myfonts.com/notexist.php?stuff=things


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'

-Chris

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-16 01:51 UTC] sniper@php.net
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] philip@php.net
Am working on this.  There are several REDIRECT_* predefined vars to use.

See also: http://httpd.apache.org/docs/custom-error.html
 [2003-01-19 15:50 UTC] philip@php.net
This is actually part of an open phpdoc feature request made here:

http://bugs.php.net/7741

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-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 19 16:01:32 2020 UTC