Some time ago I asked this question, but that thread was closed (after 3 months). Today I believed to have found the answer, that is
if ($_SERVER['SERVER_NAME'] = "localhost")
{$yourwebsiteA = "http://localhost/your path/yourwebsiteA/";
$yourwebsiteB = "http://localhost/your path/yourwebsiteB/";
$yourwebsiteC = "http://localhost/your path/yourwebsiteC/";
}
else
{$yourwebsiteA = "http://remote path/yourwebsiteA/";
$yourwebsiteB = "http://remote path/yourwebsiteB/";
$yourwebsiteC = "http://remote path/yourwebsiteC/";
}
This code works for the if
part, but not for the else
one: in remote I have still a localhost
value, even server_name
is not localhost
.
Where I’m wrong?