CodeIgniter Forums

Full Version: 1.6.1 Default Controller causing 404 error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]kilishan[/eluser]
I've got the issue with the blank screen fixed up. Now I'm getting a 404 error. But it only happens on the front screen, where it uses the default controller. I've tracked the error down to the Routes library, in the _validate_request function. The url it's trying to create earlier in the build is missing the controller name. Is this a bug or do I have something bungled?

Server is running CentOS 5, PHP 5.2.5, CodeIgniter 1.6.1.

Thanks!

El Forum

[eluser]gtech[/eluser]
if you echo site_url() in a test controller what do you get?

say if you have a controller home, and the home controller has mehtod called index:

Code:
<?php
class Home extends Controller   {
        function Home(){
             parent::Controller();
        }

        function index()
        {    
             echo "test";
        }
}
?>

if your base_url is set correctly and index_page = 'index.php' in the config file and the default controller is set to home in the routes file: $route['default_controller'] = "home";

http://<site>/<ci_install>/
http://<site>/<ci_install>/index.php

should be the same as going to the url

http://<site>/<ci_install>/index.php/home/

El Forum

[eluser]gtech[/eluser]
if the above does not work

you can try changing the URI protocol and if that does not work change index_page to 'index.php?' in the config.php

[url="http://ellislab.com/codeigniter/user-guide/installation/troubleshooting.html"]See the trouble shooting section of the userguide[/url]

El Forum

[eluser]kilishan[/eluser]
Doh! Changing the URI Protocol worked. I had tried that before, but that was while I was having the other problems, so mentally I had it checked off the "to try" list. Thanks for the reminder. That one was driving me nutty. Smile

El Forum

[eluser]gtech[/eluser]
glad to help