CodeIgniter Forums
using parked domains as codeignitaer controllers - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: using parked domains as codeignitaer controllers (/showthread.php?tid=64374)



using parked domains as codeignitaer controllers - nasser.man - 02-14-2016

Hi , i have an application built on codeigniter, and there is some controllers like this :

mainsite.com/resellers/controller_a/method_a/input/resellerID

that resellers is directory , controller_a is name of controller and method_a is name of function and input is posted input values, and resellerID is id of reseller,

how i can have this :

mainsite.com/resellers/controller_a/method_a/input/1 equals to otherdomain1.com//controller_a/method_a/input/
mainsite.com/resellers/controller_a/method_a/input/2 equals to otherdomain2.com//controller_a/method_a/input/
mainsite.com/resellers/controller_a/method_a/input/3 equals to otherdomain3.com//controller_a/method_a/input/
....


RE: using parked domains as codeignitaer controllers - nasser.man - 02-14-2016

i find this way but i don't know it is right solution or not,

i can set some rules into route.php configuration file, like this :

if ($_SERVER['HTTP_HOST']=="otherdomain1.com") {
$_SESSION['resellerID'] = '123';
}

if(isset($_SESSION["resellerID"])){
echo $_SESSION["resellerID"];
}
else {
echo 'session is not setted !';
}

and use this resellerID anywhere i need to get reseller ID,