2

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.

  • Refer this : https://stackoverflow.com/a/13955395/5188344 – Rajan Jul 10 '17 at 09:39
  • It does not solve my problem. When i type (http://localhost/gms/admin) it loads back-end successfully but when i type (http://localhost/gms/client1/admin) it shows The page you requested was not found. @Rajan – HazemMohamed Jul 10 '17 at 12:16

1 Answers1

1

in routes.php

$route['gms/(:any)/admin'] = 'gms/admin';

in gms controller

public function admin(){
    $client = $this->uri->segment(2);
    echo $client;
}
Kundan Prasad
  • 556
  • 5
  • 10