note 64565 added to function.header
| From: | php-general at lists dot php dot net | Date: | Tue, 18 Apr 2006 20:27:39 +0000 |
| Subject: | note 64565 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-108435@lists.php.net to get a copy of this message | ||
PHP does not appear to work with Apache's ability to interpret 'location' URLs
starting with a '/' as "internal redirects" -- redirects that are handled
internally by Apache and not sent back as 302 Redirect responses to the client. This can be useful
for hiding the real location of a file but having Apache still handling the download of the file.
For example, the header:
Location: /hidden-dir/secret-file.jpg
If this is generated from a regular CGI script, Apache will open the file in the hidden-dir
directory and send that back to the client without sending back an updated URL.
With PHP, the client receives the 302 Redirect response, including the url
/hidden-dir/secret-file.jpg and has to fetch the content under that URL (and usually changes the
displayed URL as well, thus un-hiding it.)
I assume the reason that this doesn't work with PHP is that PHP automatically generates a 302
Redirect header when it sees the Location header even though that might not be what you want. It
would be nice if there was a way to tell PHP to *not* generate the 302 Redirect header but *just*
the Location header.
----
Server IP: 216.194.113.175
Probable Submitter: 65.211.58.5
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/note/edit/64565
Del: integrated -- http://master.php.net/note/delete/64565/integrated
Del: useless -- http://master.php.net/note/delete/64565/useless
Del: bad code -- http://master.php.net/note/delete/64565/bad+code
Del: spam -- http://master.php.net/note/delete/64565/spam
Del: non-english -- http://master.php.net/note/delete/64565/non-english
Del: in docs -- http://master.php.net/note/delete/64565/in+docs
Del: other reasons-- http://master.php.net/note/delete/64565
Reject -- http://master.php.net/note/reject/64565
Search -- http://master.php.net/manage/user-notes.php