Redirecting by hostname
| From: | Wing | Date: | Wed, 27 Feb 2002 00:47:17 +0000 |
| Subject: | Redirecting by hostname | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-86347@lists.php.net to get a copy of this message | ||
I'm trying to use the code below to redirect a certain hostname (in this
case splitrock.net) to a different website (in this case www.test.com) As it
is now, I am (using splitrock.net) not being redirected at all. This code
will be prepended to every document on my server to prevent certain people
from accessing it.
$Redirect_Page="http://test.com";
if(ereg("splitrock.net$","$REMOTE_ADDR||$REMOTE_HOST")){header("location
: $Redirect_Page");}