the title seems stupid. but i met the problem,
now i can just type http://ci.tao2tw.com, then routes to my index.php/entry function
but when i type http://ci.tao2tw.com/order , i wanna routes to another controller
order.php , however it doesn’t work !
is anything wrong in my setting??
now , i can not run test function under order controller by http://ci.tao2tw.com/order/test . instead, i should type
htpp://ci.tao2tw.com/index.php/order/test
i can not figure out??
thank you all in advance~



in routes.php
$route['default_controller'] = "index/entry";
$route['order'] = "order";
$route['404_override'] = '';
in config.php
$config['base_url'] = 'http://ci.tao2tw.com/';
$config['index_page'] = '';
in controller/index.php (it works fine )
class Index extends CI_Controller {
public function __construct() // to remember use public
{
parent::__construct();
$this->load->helper('url');
//anchor();
}
public function entry() //just show index
{
$this->load->view('index_view',$data);
}
}
in controller/order.php ( no work )
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Order extends CI_Controller {
public function __construct() // to remember use public
{
parent::__construct();
$this->load->helper('url');
}
public function fill($action) // 顯示填寫表單
{
echo "test";
}
//http://codeigniter.com/user_guide/libraries/uri.html
public function order($action)
{
echo $action;
}
}
?>
.htaccess file
RewriteEngine on
RewriteCond $1 !^(index\.php|css|flash|images|img|includes|js|language|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
~
Every controller must be called in CI after your index.php file.
So if you don’t use a .htaccess file, your link to the order controller is like :
The .htaccess allows to skip the index.php file
You can so call your controller with :
Then, if you want to call a method in your order controller your url is :
without the .htaccess
http://ci.tao2tw.com/index.php/order/fill
with the .htaccess
http://ci.tao2tw.com/order/fill