I am with CI a couple of days only. Previous experience - .NET C#.
My controller:
class Project extends CI_Controller {
public function __construct() { parent::__construct(); }
public function index() {
echo 'To be or not to be?';
}
}
The file name /application/config/controllers/Project.php
The routes.php:
$route['default_controller'] = 'home';
$route['project'] = 'project';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
The route for the default_controller works, no problem. $route['project'] returns 'Object not found', 404. The route's position in the list does not change anything. If I use http://my-site.com/index.php/project - this works fine.
Should I use .htaccess file? I did not think that it is an obligatory condition.
Where am I wrong?
Thank you in advance.
$route['project'] = 'project';is not necessary. You only need to use routes when you want to deviate from the CI convention ofexample.com/class/function/id/. - DFriend