Hello!
I am trying to write a script that will allow users of my hosting server to set up their own subdomains. The script has to compare HTTP_HOST with an array of subdomains and then redirect to a directory. But when I request HTTP_HOST, headers have been sent so I cannot perform Header("Location: ..."). After trying and trying for example JavaScripts' location.href I came up with a solution that uses two files: one with a <META HTTP-EQUIV="Refresh"> to another script while appending ?host=$HTTP_HOST. The other script can then compare $host in stead of $HTTP_HOST. This works ok.
But somehow this looks silly to me since php can then get a hold of the GET variables which are in the url, but why can't it get the entire url that's in the location-bar of my browser without having to request HTTP_HOST?
In other words, is there any other way to write a script as desribed above?
Thanks very much in advance!
I apoligize for my (maybe) bad english