-2

I have a controller messages. And there is a function called index.

 class messages extends CI_Controller {

       public function __construct() {
           parent::__construct();


       public function Index($userkey=NULL){

                     Some functctions

 }

}

Currently my URL is messages/index/userkey. And i want to convert this to messages/userkey. How can i convert this by routes. please help me

Meera
  • 107
  • 1
  • 1
  • 12

1 Answers1

0

You can find the CI Route docunment here: http://ellislab.com/codeigniter%20/user-guide/general/routing.html

-find 'application/config/routes.php' file

-add your rule to $route array

$route['messages/(:any)'] = "messages/index/$1";
Chen-Tsu Lin
  • 22,876
  • 16
  • 53
  • 63