mothra
01-31-2004, 08:38 PM
On my development box (Apache/1.3.27 PHP/4.2.3) I have my root and sub directories set up the same as my hosts server does. I keep all of my php scripts in one directory and my content pages under the root and/or sub-directories under the root. When I call Header from a script it does not work on my hosts server, but it does work on my box. Here is an example:
This one works on my box, but not on hosts server
<?php
header("Location: /test.php");
?>
This is my fix, but why should I have to do this??
<?php
header("Location: HTTP://" . $_SERVER['HTTP_HOST'] . "/test.php");
?>
So what gives? Is it an issue with my host maybe? I don't know if it is related or not, but echoing $_SERVER[DOCUMENT_ROOT] does not return anything from the host either.
This one works on my box, but not on hosts server
<?php
header("Location: /test.php");
?>
This is my fix, but why should I have to do this??
<?php
header("Location: HTTP://" . $_SERVER['HTTP_HOST'] . "/test.php");
?>
So what gives? Is it an issue with my host maybe? I don't know if it is related or not, but echoing $_SERVER[DOCUMENT_ROOT] does not return anything from the host either.