note 23295 deleted from faq.installation by sniper
| From: | sniper@php.net | Date: | Tue, 27 Aug 2002 20:57:36 +0000 |
| Subject: | note 23295 deleted from faq.installation by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-35795@lists.php.net to get a copy of this message | ||
I'm having a strange problem. I just installed Apache 1.3.26 and PHP 4.2.1 as a CGI on Windows
XP with a virtual host.
The really strange thing is that when I run a script I've written that checks what server
it's running on it doesn't get the correct server name. Both $HTTP_HOST and $SERVER_NAME
are empty.
The code I use is as follows:
if(($HTTP_HOST != "gulli") && ($HTTP_HOST != "www.gulli.net"))
{
header("Location: http://www.gulli.net".$REQUEST_URI);
}
This forces the browser to move to www.gulli.net/.... every time even when I'm running the
script at 'gulli'. I would think that I'd have done something wrong except that when
I add phpinfo(); in the SAME script both $HTTP_HOST and $SERVER_NAME return 'gulli' like
they should.
Any ideas? This is really getting on my nerves!
Thanks
Gulli