Re: Seeking Comments - Regarding header()
| From: | Rasmus Lerdorf | Date: | Fri, 21 Jun 2002 09:06:36 +0000 |
| Subject: | Re: Seeking Comments - Regarding header() | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-85440@lists.php.net to get a copy of this message | ||
> > The HTTP/1.1 spec says that anything sent as a location header must be an
> > absolute URI. Apache will sometimes segfault if you don't.
> >
> > If a specific redirect() function were to be implemented, would it be
> worth
> > examining the URL passed into the function to see if it is absolute (e.g.
> if
> > it contains '://') and if it isn't, making it absolute by adding
> > $_SEVER['HTTP_HOST']?
>
> What's stoping people to write userspace function using header('HTTP/1.0 xxx
> ...') and header('Location: ...')?
The header('location') call would override the status code set in the
header('http') call. That's the whole issue here. header('location')
forces a 302 currently.
-Rasmus