Codeigniter 404 Error - Controllers Not Found |
[eluser]Unknown[/eluser]
I'm trying to get a development server working and have a fresh install of Ubuntu 13.10 with apache2 and php5 installed on it. On a fresh codeigniter install, the latest available (2.2.0), I can navigate to the default controller index function by using the base url, as configured in the config.php. i.e. http://example.com/ci/ -> brings you to the default controller, welcome.php and the index function. However, when navigating to http://example.com/ci/welcome/index or http://example.com/ci/index/ I get a 404 error. It seems to be that apache is seeing these as directories instead of reading the codeigniter controllers. Everything in Apache is set to the default settings as well as php.ini, I have no .htaccess enabled because the ones I have tried have been unsuccessful. These are the modules enabled given by phpinfo(): Code: core Any ideas?
[eluser]CroNiX[/eluser]
If you are not using htaccess to reroute the requests to index.php, you need to include index.php in the url, like www.yoursite.com/ci/index.php/controller. The only time you don't is when going to the homepage/default controller.
[eluser]Unknown[/eluser]
Ah, I didn't know that! But yes you're right, navigating through like that works perfectly. I couldn't understand why it was working through the index.php like that. Thanks CroNIX
[eluser]CroNiX[/eluser]
Just a FYI, those modules you listed in your first post are apache modules, not php. If you want to remove "index.php" from the url via htaccess, you need to enable the mod_rewrite apache module. That's why you couldn't get htaccess/rewrite to work before. |
Welcome Guest, Not a member yet? Register Sign In |