CI routing - cannot make it work |
Hi friends,
I am with CI a couple of days only. Previous experience - .NET C#. My controller: Code: class Project extends CI_Controller { The file name /application/config/controllers/Project.php The routes.php: Code: $route['default_controller'] = 'home'; 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. PHP Code: $config['index_page'] = ''; ./application/config/config.php Set that and use a .htaccess file to remove the index.php Code: DirectoryIndex index.php Give that a try. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Thank you InsiteFX,
I decided not to change $config['index_page']. Therefore the RewriteRule in my .htaccess looks so: RewriteRule ^(.*)$ index.php/$1 |
Welcome Guest, Not a member yet? Register Sign In |