tags:

views:

80

answers:

2

2 of my urls, for example www.abc.com and www.def.com point to the same .php file. I have some text on that target page that needs to be dynamically changed depending on whether it came from www.abc.com or www.def.com. Can this be done? How?

+3  A: 

See $_SERVER['HTTP_HOST'] for the host name of the current request.

Gumbo
wow..that was fast. Thanks Gumbo.
A: 

In Apache's configuration, configure both hostnames to point to the same directory. If this is not possible, because you are on shared hosting for example, then you may still be able to use symlinks for both hostnames.

In PHP, you can determine the hostname that was used with the variable $_SERVER['HTTP_HOST'].

thomasrutter
Thanks thomasrutter.