How to pass parameter after baseurl in codeigniter?
问题 Base URL: http://localhost/f1/ and I am passing parameter in URL like: http://localhost/f1/user1 and I am trying to print function index(){ echo $this->uri->segment(2); } I want to print User1 in the controller. How to achieve this? 回答1: Config your rout and add this: $route['Controller_Name/(:any)'] = 'Controller_Name/index/$1'; Here you go with your controller class Controller_Name extends CI_Controller { function index($prm){ echo $prm; } } Have fun.... you can have how many uri you want..