Re: HTTP redirects, Location: header, and IE5 problems

From: Date: Mon, 25 Sep 2000 22:50:07 +0000
Subject: Re: HTTP redirects, Location: header, and IE5 problems
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-17375@lists.php.net to get a copy of this message
You are on the right track, but don't forget to be HTTP compliant, you also need to send the ERROR CODE! For example: header('302'); header('Location: http://some.location.on.another.planet'); exit(); (Don't forget the exit() call as well. Some versions of IE and AOL (and others I'm sure) then take the rest of the output and display it to the use and never redirect even when you tell it "302". -jeremy brand _______________________________________________________________________ GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9 _ http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more __ On Fri, 22 Sep 2000, Greg Billock wrote: > Date: Fri, 22 Sep 2000 12:13:41 -0700 > From: Greg Billock <billgr@sunoptics.caltech.edu> > To: php-general@lists.php.net > Subject: [PHP] HTTP redirects, Location: header, and IE5 problems > > I have been frustrated recently working with IE5.01+ and > HTTP redirects. In PHP, these are most easily done with > the header("Location: $url"); call, which magically updates > the HTTP return code and everything. :-) > > So the problem is that Internet Explorer v. 5 and above > are just returning Error - Page Not Found when given data > like this. What is going on? > > At present, it looks to me like the problem is that IE5.01 > and IE5.5 are set to default not to honor the HTTP/1.0 spec, > and take absolute URLs in the Location header. Instead, > they display an error. If they are given a *relative* URL, > then they are OK. > > Can anyone confirm this as a general observation, or even > more specifically? Can IE5 be set not to ignore the specification > for HTTP headers? I have observed this broken behavior with > IE5.5 on two other sites besides those of mine which try to > do redirects. One looks like it uses Python to issue redirects > and the other uses Perl, so I think this is an issue with Explorer. > > As a workaround, Netscape seems to accept relative > paths in the Location header, so that is the indicated > thing. (I guess if you want to do off-site redirects, you > have to find some other mechanism. Perhaps the > HTTP/1.1 Content-location header? I'm not sure...) > > -Greg Billock > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#17375) next »