This is one of those things that just makes me feel like an idjut.
Ok - so I am just starting out with Codeigniter and I just am having a hell of a time getting my head around the URL system.
Here are some relevant config settings up front ( and I'm on MAMP/localhost at the moment )
$config['base_url'] = 'http://localhost:8888/MY_SITE/';
$config['index_page'] = 'index.php';
$route['default_controller'] = "home";
My .htaccess
file is blank as of now.
So I have a "home" controller, which I hit fine, and it loads my "home_view". On it I have a registration link ...
<p>Not a member yet? <a href="<?php echo site_url('registration'); ?>">Sign Up!</a></p>
This renders as the following HTML ...
<a href="http://localhost:8888/MY_SITE/index.php/registration">Sign Up!</a>
Everything fine so far. But when I click I get a "404 Page Not Found". I have a "registration.php" controller with an index method that loads a "registration_view.php".
This is what is showing in my address bar
http://localhost:8888/MY_SITE/index.php/registration
Why do I not hit it?
My logs show ..
ERROR - 2012-11-13 18:21:12 --> 404 Page Not Found --> registration/index
.. WHY DOES FATE HATE ME SO?
One of many possible and most close reason for 404 might be that there's no index()
function in your controller. Can u post the code??
EDIT ( Since ans got downvote ) I have to give more explanations.
In this case possible reasons for 404 error can be -
registration
controller.registration
present in your default home controller.private
then you get 404.Just for note, to make URLs more readable you should include htaccess and add rules to remove index.php.