Welcome Guest, Not a member yet? Register   Sign In
Default controller in index.php & routes.php
#1

[eluser]Unknown[/eluser]
I set the default controller/function in index.php. This feature really solve a lot of coding effort for my old sites.

It used to work and today it stop working. I kept getting 404 page not found.

After debugging, I notice that the name of default controller coded in routes.php, is pointing to an invalid controller name (I renamed that controller today).
I changed the default controller in routes.php to some valid controller name and my index.php works again.

Even though CI is using the default controller in index.php, somehow CI still check for the default controller in routes.php

2 points to note if you set default controller in index.php
1) The default controller in routes.php must be valid
2) Always set 3 variables in index.php. Initially I did not set $routing['directory'] and it does not work.
- $routing['directory']
- $routing['controller']
- $routing['function']

Just to share my experience because I benefited a lot from this forum.



Messages In This Thread
Default controller in index.php & routes.php - by El Forum - 03-11-2012, 06:48 PM
Default controller in index.php & routes.php - by El Forum - 03-11-2012, 11:05 PM
Default controller in index.php & routes.php - by El Forum - 03-12-2012, 12:39 AM
Default controller in index.php & routes.php - by El Forum - 03-12-2012, 01:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB