I get "wrong" url when i use $_SERVER['REQUEST_URI']
on my website, to view what the URL/domain is. The website have to entry domains www.liceng.dk and www.licenergy.co.uk
But no matter what domain I visit, the $_SERVER['REQUEST_URI']
shows as http://www.liceng.dk/
. How come? And can i get the domain that is showing as URL somehow, using PHP?
My goal is to change the logo depending on what domain the visitor is using to watch the website. But i can't do that if i can't differentiate what domain the used to get to the website.
The actual HTTP HOST used to request the site will be available in $_SERVER['HTTP_HOST']
. Use that value to switch the default logo / language / etc. depending on which site is being accessed.