I am going to create a website in codeigniter. But not sure if the method I'm going to use is the best approach. On one site there will be many addon domains. But the content will be filtered based on the domain used to visit the site.
For example, if a user comes from a domain
siteusa.com, then the content will be displayed by an appropriate filter. If the user comes from siteuk.com/sitechina.com, the content will be transferred accordingly, etc ....
I plan to do something similar to detect the url and serve the content
$ref = getenv("HTTP_REFERER");
echo $ref;
Another problem I see is the codeigniter base parameter, but I saw a solution for this here
if(isset($_SERVER['HTTP_HOST']))
{
$config['base_url'] = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http';
$config['base_url'] .= '://'. $_SERVER['HTTP_HOST'];
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
}
else
{
$config['base_url'] = 'http://localhost/';
}
? , ?
, .