- Open ‘application\config\routes.php’
- Add these line to routers.php:1$route['product/:any/:any'] = 'catalog/product/$1/$2';
- Open ‘application\controllers’ Folder and Create a File catalog.php.
- Paste this code to catalog.php :12345678910<?phpclass Catalog extends CI_Controller{public function product(){echo $this->uri->segment(1);echo $this->uri->segment(2);echo $this->uri->segment(3);}}
- Now Type “http://localhost/CodeIgniter/product/mobile/nokia” URL in Browser.
- You can see all three segment:
segment 1 : product
segment 2 : mobile
segment 3 : nokia