faqts : Computers : Programming : Languages : PHP : Common Problems : HTTP Headers

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

18 of 32 people (56%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

I have two subdomains pointing to the same index.php3. How can I find out which subdomain was entered by the user?

Aug 17th, 2000 16:48
Kelson Vibber, Kaspar Althaus,


Use the HTTP Host variable (in PHP, this shows up as $HTTP_HOST).  
That'll tell you whether the user is looking at site1.mydomain.com or 
site2.mydomain.com (or even www.myotherdomain.com).