Reputation: 31
I'm just starting a new saas project alone and I'm stuck in Codeigniter's URI configuration.
I'm using xampp, and so far I have a folder with my site in it with it's own database. If a client register to my product a new subfolder will be generated also new database will be generated related to this client. The main URL is as ex: (http://localhost/gms/admin) but how to manage urls from clients like this : (http://localhost/gms/client1/admin) .... etc and after client log with his new specific url it SHOULD load the related database.
I Took time to solve it. Please need it necessary.
Upvotes: 2
Views: 118
Reputation: 576
in routes.php
$route['gms/(:any)/admin'] = 'gms/admin';
in gms controller
public function admin(){
$client = $this->uri->segment(2);
echo $client;
}
Upvotes: 1