I have 2 domainnames but they refer to the same site.
xxx.be and xxx.com. Now I want to know on what domain I'm.
if I'm on .be I have to go to page x, if I'm on .com I have to go to page y...
i don't think either of Miros' suggestions will give you directly the answer that you are looking for.
$_SERVER['PHP_SELF'] just stores the filename of the active script.
i suspect you will be looking for the value stored in $_SERVER['SERVER_NAME'] which will give you the virtual host (or host) under which you are operating.
similarly $_SERVER['HTTP_HOST'] will contain the hostname that was actually requested by the user.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.