CodeIgniter Forums

Full Version: routing problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I am just starting with CI and try to set up my first application with this framework.
the homepage is displayed properly.
in routes.php I have this entry:
$route['info/(:any)'] = 'info';

so this should point to the info-Controller (Info.php), and invoke the function index.
isn't it?
Controller and function do exist, but I always get error 404, page not found.
what's wrong here?
(10-25-2015, 05:27 AM)helmut Wrote: [ -> ]Hello,
I am just starting with CI and try to set up my first application with this framework.
the homepage is displayed properly.
in routes.php I have this entry:
$route['info/(:any)'] = 'info';

so this should point to the info-Controller (Info.php), and invoke the function index.
isn't it?
Controller and function do exist, but I always get error 404, page not found.
what's wrong here?

When you need to use (:any) in your  route


PHP Code:
$route['info'] = 'info/index';
$route['info/(:any)'] = 'info/index/$1'

http://www.codeigniter.com/user_guide/ge...uting.html

Checks make sure first letter upper case

Filename : Info.php

class Info extends CI_Controller {}

You also may need to include index.php in url

http://localhost/project/index.php/info
(10-25-2015, 10:28 PM)riwakawd Wrote: [ -> ]You also may need to include index.php in url

http://localhost/project/index.php/info

That's the solution!

thanx a lot!