PDA

View Full Version : Which domain is used?!


Dr-Leech
08-18-2002, 02:02 AM
Hi..

I'm looking the way to detect what domain is used to enter the same site.

ie: i've a site and 2 domains that redirect to this.. blah.com and bleh.com
in both cases the site is the same.. in fact, the site have 2 differents domains..

and i want to make a script that checks which of these domains has used the user and if the domain is bleh.com, redirects to blah.com/blehdirectory/

is it possible?

Thanks..

firepages
08-18-2002, 02:19 AM
vis php the $_SERVER['HTTP_HOST']; variable holds the hostname you will be able to redirect from that, or you could use apache's mod_rewrite

if(strstr($_SERVER['HTTP_HOST'],$domain)){//blah