user191688
user191688

Reputation: 2659

How do I display the requested url via a handler for parked domains

I have a web directory to which several parked domain names are pointing. What I would like to do is know which domain name the visitor requested via browser address bar or link.

I will have a single handler index.php that will determine the requested domain name and display content accordingly.

Something like: Hello, and welcome to example.com

Thanks

Upvotes: 0

Views: 266

Answers (1)

user142162
user142162

Reputation:

You would access the superglobal $_SERVER and its key HTTP_HOST:

echo 'Hello, and welcome to ' , $_SERVER['HTTP_HOST'];

Upvotes: 2

Related Questions