You may try any one of these
// url could be yourdomain/imran
$route['(:any)'] = 'profile/index/$1';
// url could be yourdomain/10
$route['(:num)'] = 'profile/index/$1';
// url could be yourdomain/imran10
$route['([a-zA-Z0-9]+)'] = "profile/index/$1";
Your class may look like this
class Profile extends CI_Controller {
public function index($id)
{
// $id is your param
}
}
Update : (Be careful)
Remember that, if you have a class Someclass
and you use url
like yourdomain/Someclass
then this will be routed to profile/index/$1
if you have $route['(:any)']
or $route['([a-zA-Z0-9]+)']
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…