I'm going to develop a website in PHP. But not sure if the method i'm going to use is the best approach. There will be many addon domains for the same site. But content will be filtered based on the domain used to visit the site.
For Example If a user comes from the domain siteusa.com then the content will be shown filtered accordingly specific user. If the user comes from siteuk.com/sitechina.com the content will be filetered accordingly etc...
I'm planning to do something like this to detect the url and serve content
$ref = getenv("HTTP_REFERER");
echo $ref;
or by
$host = $_SERVER['HTTP_HOST'];
echo $host ;
Is this is the best method to do this? Is there any possible bottleneck I may get into? This should not fail to detect the domain as its critical.
The main domain of the site will be serving unfiltered content and each addon domain will filter it according to filter set for each domain from backend.
There is a smilar question but in regard with codeigniter here.