Forum Moderators: coopster

Message Too Old, No Replies

Unable to redirect in Firefox with PHP

Redirect in FireFox

         

sreenushetty

4:17 pm on Jan 27, 2006 (gmt 0)

10+ Year Member



if ($country == "DE")
{
header("Location: http://www.example.com/change_language.php?lang=de");

} else {

// Otherwise, redirect them to ENG site

header("Location: http://www.example.com/change_language.php?lang=eng");

}

This piece of code is working just fine in IE but not in Firefox, not able to figure out the problem. Could any one help please?
Thanks

[edited by: encyclo at 5:37 pm (utc) on Jan. 27, 2006]
[edit reason] switched to example.com [/edit]

encyclo

6:05 pm on Jan 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums sreenushetty.

How are you determining the value of

$country
? Are you parsing the Accept-Language header, and what value does your version of Firefox give?

stajer

9:08 pm on Jan 27, 2006 (gmt 0)

10+ Year Member



There is a redirect bug in Firefox that may be causing the problem. Google "firefox redirect bug" and you should be able to find the mozilla.org bug report.

Try restarting then running your code on FF right away - if it works, then the FF bug is causing the problem.

sreenushetty

10:03 pm on Jan 27, 2006 (gmt 0)

10+ Year Member



Hi Friends,

Thank for your replies.

<< How are you determining the value of $country? >>
$coutry is coming from db, depending on the IP address..
Redirection is happening in firefox but the concerned page is not opening.

I tried surfing for firefox bugs but invain.

If you need complete code, I can provide...

encyclo

2:06 am on Jan 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried explicitly closing the connection once the redirect has been sent?

 if ($country == "DE")
{
header("Location: http://www.example.com/change_language.php?lang=de");
[b]exit;[/b]
} else {
// Otherwise, redirect them to ENG site
header("Location: http://www.example.com/change_language.php?lang=eng");
[b]exit;[/b]
}

sreenushetty

4:31 pm on Jan 29, 2006 (gmt 0)

10+ Year Member



Yes I tried but the problem remains the same :-(

JAB Creations

2:56 am on Jan 30, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check to ensure you do not have the "RefreshBlocker" extension installed and enabled or the Web Developer Toolbar option under Disable --> Meta Redirects.

On some rare occasions my preferences will collide with my goals. ;) Hope this helps.

John