Question

I would like to run 2 domains on same codeigniter base and each should reflect 2 different languages. What I would like to have schematically

domain.fr/controller/method should point to french content
domain.org/controller/method should point to english content

What is the best workaround to achieve this

Was it helpful?

Solution

You will have to do something like do a route re-write and redirect them to different content OR set a variable:

Example:

switch ($_SERVER['HTTP_HOST']) {
    case 'domain.fr':  $route['default_controller'] = "french"; break;
    case 'domain.org': $route['default_controller'] = "spanish"; break;
    default: $route['default_controller'] = "english"; break;
} 

My example illustrates with controllers but you can set the

$config['language'] = 'english';

to something else (override the config.php)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top