Actually, about 10 years ago I wrote the whole web site using php and I do not recall having issues like these.
Unfortunately your answers do not clear much and create more questions.
So, why
$geturl = $_SERVER['HTTP_HOST']; // Defines the variable
and
$geturl = "domain";
does not?? What's the...