joined:Mar 20, 2008
I posted this question in another busy forum but noone can answer my question. The problem.
I have a website, lets say, mydomain.com
with multiple mirror domains. Multiple domains point to the same website. I need to display different content/language depending of the domain which user is using to enter my website.
Some time ago I was thinking that it's very easy:
$userhost = $_SERVER["SERVER_NAME"];
$userhost = $_SERVER["HTTP_HOST"];
$userhost = getenv("HTTP_HOST");
Yes, it works, but not always. In some cases $userhost is something like that: domain
1) Does it mean that there is no way how to detect the domain in php so that it works 100% always?
2) Can you show an example how can I enter website www.mydomain.com
telling php that my $userhost something different as www.mydomain.com