I have a very strange problem:
I am doing a 301 redirect
header( "HTTP/1.1 301 Moved Permanently" );
echo "Location: " . $newurl;
header( "Location: " . $newurl );
This works perfectly
But the problem is when it goes to the new page
In that new page I have certain conditions and if the conditions are not fulfilled then it redirect to a page not found.
if($determiner == "page_not_found")
{
header("Location: http://www.domain.com/page_not_found");
}
BUT in the new page no matter what I do it always goes to "page not found" page, even if all the conditions are met.
But if I echo a character, even a space, the page will load correctly if the conditions are met
echo " ";
if($determiner == "page_not_found")
{
header("Location: http://www.domain.com/page_not_found");
}