Ewrt Wert
Ewrt Wert

Reputation: 21

PHP header redirection does not work on IE 8

A redirection under php:

header("Location: mask.php")

does work with IE 9, google chrome, firefox, but not with IE 8.

How can I fix this?

PS: header("Location: http://......") does not help.

Upvotes: 0

Views: 4066

Answers (3)

GrahamOConnell
GrahamOConnell

Reputation: 16

I just had this issue and this post still comes up in Google. The solution that worked for me was to include the www in the URL.

Example:

header("Location: http://www.example.com/mask.php");
exit();

Cheers.

Upvotes: 0

Mihai Iorga
Mihai Iorga

Reputation: 39704

You lack ; at the end end you need to exit your script so no script is executed anymore.

<?php
    header("Location: mask.php");
    exit; // with die at the end
?>

To test on IE make a sample page that redirects someplace and test on NetRenderer

Upvotes: 7

s.webbandit
s.webbandit

Reputation: 17000

Add die(); after.

Like:

header("Location: mask.php");
die();

Upvotes: 0

Related Questions