I have 5 domains which are re-directed to a single hosting. I am using Joomla on the website having an issue with banner. I want that if someone redirected from domain1 the hosting site shows banner for domain1, domain2 banner2 and so on.
What would be the best methodology whether in Joomla or Core PHP?
You need to use
'HTTP_REFERER'in PHP’s$_SERVERsuperglobal. Read the manual for more information.Basically,
HTTP_REFERERcontains the URI of the site that was directed to your host. It’s not guaranteed to actually contain a value, but it’s your best bet without involvingGETvariables issued in the URL. Note: you will have to parse out the domain name before you can use it.The manual has this to say…
Your code might look like this…
If you have any control over the re-directing domains, you could fall back to using GET vars in the redirect, like so…