note 23295 added to faq.installation

From: Date: Mon, 15 Jul 2002 00:21:27 +0000
Subject: note 23295 added to faq.installation
Groups: php.notes 
Request: Send a blank email to php-notes+get-33062@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 -- http://www.php.net/manual/en/faq.installation.php http://master.php.net/manage/user-notes.php?action=edit+23295 http://master.php.net/manage/user-notes.php?action=delete+23295 http://master.php.net/manage/user-notes.php?action=reject+23295

« previous php.notes (#33062) next »