Please see the following controller in CodeIgniter 2
<?php
class user extends CI_Controller {
function __construct() {
parent::__construct();
}
function index($id) {
// do something here
}
}
?>
So my URL would be http://mydomain.com/user/index/2
But what I really want is to be able to not have the 'index' in the URL, so the URL would be http://mydomain.com/user/2
Does anybody know how I can achieve this?
Tha开发者_如何学编程nks in advance
My other answer is to get rid od the index.php, but I didn't realize that's not what you asked.
I have had to deal with this issue so what I did was add a regex number route:
$route['(:num)'] = '/user/index/$1';
精彩评论