First off – apologies if this isn’t the correct forum – but couldn’t really see a better home for it.
I want to build a site that directs a visitor to a page depending on which subdomain they used when they visit my site. I would build this in php, but the issue is more about how the site knows which subdomain was used in the first place (which is why this probably isn’t a php question). In my domain manager panel I can set redirects for any subdomain based on a wildcard, but I can’t see how the original subdomain information can be forwarded to my site.
eg Someone browses to red.mydomain.com and gets forwarded by the domain manager to mysite.com. The script (if it could be made to work) would identify that the original URL entered was red.mydomain.com, and forward them to a red page. If someone typed blue.mydomain.com, then they might go to a different page – hopefully you can see the idea, although please don’t ask why!
I think this boils down to how to configure a domain manager subdomain redirect such that the original subdomain is retained as the refering URL. If that isn’t possible, any other thoughts about how to solve this conundrum? I want to be able to do this for maybe hundreds of different subdomains, so setting up each subdomain redirect on the domain manager panel isn’t an option since they can only support 100.
Thank you ?