Page 1 of 1

Header redirect fails

Posted: Thu Nov 05, 2009 10:01 am
by powrtoch
I know this first thing you think is "no output to the browser before the header function". There isn't any. No tags, no spaces, no line breaks, nothing. I don't even have a "headers already sent" error displaying. For some reason though, the redirect simply does not work, and my script indicates that headers are getting sent anyway. I go to the page, and I just get a blank page with the undirected url up top. Is there some php configuration variable that could cause this to fail?

Here is my ENTIRE script.

Code: Select all

<?php
    $a = headers_sent();
    header("Location: http://google.com");
    $b = headers_sent();
    echo "$a<br />$b";
    exit();
?>
The output is:
1
1

Obviously the first one should not be a 1. Any thoughts? I'm going nuts here.

Re: Header redirect fails

Posted: Thu Nov 05, 2009 11:20 am
by powrtoch
Well, if anyone cares I solved it. It wasn't a PHP problem, it was a Dreamweaver Being Crazy problem. Long story short, the fix was to open up a file where redirects did work, save it over the file where they wouldn't, and then change it from there.

Probably character encoding issue or something, I don't know, I just know I wasted my whole morning on it.