很难理解Codeigniter URL

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 -

  1. Your default controller is set home and the url on which your are getting 404 is calling registration controller.
  2. If there's no registration controller you get 404.
  3. If there's no function named as registration present in your default home controller.
  4. First arguement in URI (after index.php [if htaccess is not used to remove index.php] ) is for controller that will be called. And second argument after index.php is function that will be called from controller mentioned in first argument. In both cases, ie controller and function not present you get 404.
  5. If registration is function and it's visibility is set to private then you get 404.

Just for note, to make URLs more readable you should include htaccess and add rules to remove index.php.