Welcome Guest, Not a member yet? Register   Sign In
New User Routing Troubles
#1

[eluser]Unknown[/eluser]
I am just starting to use CI, and don't quite get how these work.

Code:
$route['default_controller'] = 'news/view';
$route['404_override'] = '';

I can have those in there, and then going to my index page will load news->view() just fine. But adding on any other ones gives me object not found when I navigate to them.

Code:
$route['default_controller'] = 'news/view';
$route['404_override'] = '';
$route['news'] = 'news/view';
$route['news/view'] = 'news/view';

Why doesn't navigating to news or news/view work if the route works?

e.g. http://localhost/folder/news doesn't work when http://localhost/folder does and they point to the same place. Didn't even begin to make it use another parameter.
#2

[eluser]Aken[/eluser]
Did you remove index.php from your URLs? If not, the link will be http://localhost/folder/index.php/news
#3

[eluser]Unknown[/eluser]
That reply was enough for me to search for 'removing index.php', and finding another post linking to http://codeigniter.com/wiki/mod_rewrite/

The user guide's first steps don't mention anything about needing index.php, and refer to every url without it, so that's a bit misleading. Thanks for your help!

(The .htaccess in there worked immediately.)




Theme © iAndrew 2016 - Forum software by © MyBB