Welcome Guest, Not a member yet? Register   Sign In
routing problem
#1

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?
Reply
#2

(This post was last modified: 10-25-2015, 10:32 PM by wolfgang1983.)

(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
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply
#3

(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!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB