IE6 mishandling header redirects

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bufferout
Forum Newbie
Posts: 3
Joined: Thu Aug 31, 2006 8:36 pm

IE6 mishandling header redirects

Post by bufferout »

Hi all,

I've got a very perplexing issue with IE6 mishandling php header redirects.

Essentially I have a link to a page that uses a header redirect to another page. Approximately every third click on this link results in a blank page in IE. The URL in IE's address bar does not change from the original address. This problem does not occur in Firefox.

My redirect code is as below. I am only passing in absolute urls to this function:

Code: Select all

function redirect($url) {
	session_write_close();
	header("HTTP/1.0 307 Temporary redirect");
	header("Location:" . $url);
	header("Connection: close");
	exit();
}

And these are the headers from IE6 when it returns the blank page (they look ok to me?):

Code: Select all

GET /members/index.php HTTP/1.1
Accept: */*
Referer: http://www.foobar.com.au/home.php
Accept-Language: en-au
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: www.foobar.com.au
Connection: Keep-Alive
Cookie: PHPSESSID=24b46360ede699f16f74218948aa750a

HTTP/1.1 307
Date: Fri, 01 Sep 2006 00:45:23 GMT
Server: Apache/1.3.33 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: close
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
X-Powered-By: PHP/4.4.2
Location: http://www.foobar.com.au/members/login.php?action=denied
Transfer-Encoding: chunked
Content-Type: text/html

GET /members/login.php?action=denied HTTP/1.1
Accept: */*
Referer: http://www.foobar.com.au/home.php
Accept-Language: en-au
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: www.foobar.com.au
Connection: Keep-Alive
Cookie: PHPSESSID=24b46360ede699f16f74218948aa750a

HTTP/1.1 200 OK
Date: Fri, 01 Sep 2006 00:45:24 GMT
Server: Apache/1.3.33 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
X-Powered-By: PHP/4.4.2
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
Content-Encoding: gzip
Content-Length: 1411
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Post by GeXus »

Try using the absolute url
bufferout
Forum Newbie
Posts: 3
Joined: Thu Aug 31, 2006 8:36 pm

Post by bufferout »

Definately already using absolute urls.

It's so wierd. If I click the link, hit back, click the link, etc this is the sort of behaviour i get:

BLANK PAGE
BLANK PAGE
BLANK PAGE
REDIRECTS
REDIRECTS
BLANK PAGE
BLANK PAGE
REDIRECTS
REDIRECTS
REDIRECTS
BLANK PAGE
REDIRECTS
REDIRECTS
BLANK PAGE
BLANK PAGE
REDIRECTS
BLANK PAGE
REDIRECTS
BLANK PAGE
REDIRECTS
bufferout
Forum Newbie
Posts: 3
Joined: Thu Aug 31, 2006 8:36 pm

RESOLVED

Post by bufferout »

Turns out to be a wierd issue on Dreamhost.

Fixed by removing character encoding and language meta tags from the html head.

Go figure.
Post Reply