title: Codeigniter: 404 on calling controller
body: <p>Accessing Url-<a href="http://localhost:82/admin/login" rel="nofollow">http://localhost:82/admin/login</a>
  Then-
  I am getting 404 "Page not found error" 
   i.e-</p>
  
  <blockquote>
    <p>Object not found!</p>
    
    <p>The requested URL was not found on this server. If you entered the URL
    manually please check your spelling and try again.</p>
    
    <p>If you think this is a server error, please contact the webmaster.</p>
    
    <p>Error 404</p>
  </blockquote>
  
  <p>localhost
  Apache/2.4.9 (Win32) OpenSSL/0.9.8y PHP/5.4.27</p>
  
  <p>My config.php
  <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>$config['base_url'] = 'http://localhost:82/admin';
  
  /*
  |--------------------------------------------------------------------------
  | Index File
  |--------------------------------------------------------------------------
  |
  | Typically this will be your index.php file, unless you've renamed it to
  | something else. If you are using mod_rewrite to remove the page set this
  | variable so that it is blank.
  |
  */
  $config['index_page'] = '';
  
  /*
  |--------------------------------------------------------------------------
  | URI PROTOCOL
  |--------------------------------------------------------------------------
  |
  | This item determines which server global should be used to retrieve the
  | URI string.  The default setting of 'REQUEST_URI' works for most servers.
  | If your links do not seem to work, try one of the other delicious flavors:
  |
  | 'REQUEST_URI'    Uses $_SERVER['REQUEST_URI']
  | 'QUERY_STRING'   Uses $_SERVER['QUERY_STRING']
  | 'PATH_INFO'      Uses $_SERVER['PATH_INFO']
  |
  | WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
  */
  $config['uri_protocol'] = 'REQUEST_URI';</code></pre>
  </div>
  </div>
  </p>
  
  <p>My routes.php</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>$route['default_controller'] = 'admin/index';
  $route['404_override'] = '';
  //$route['translate_uri_dashes'] = FALSE;
  
  
  /*admin*/
  //$route['admin'] = 'user/index';
  //$route['admin/signup'] = 'user/signup';
  //$route['admin/create_member'] = 'user/create_member';
  $route['admin'] = 'admin';
  //$route['admin/logout'] = 'admin/logout';
  
  
  $route['package'] = 'package';</code></pre>
  </div>
  </div>
  </p>
  
  <p>My controller Admin.php</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  defined('BASEPATH') OR exit('No direct script access allowed');
  
  class Admin extends CI_Controller {
  
   /**
    * Index Page for this controller.
    *
    * Maps to the following URL
    *   http://example.com/index.php/admin
    * - or -
    *   http://example.com/index.php/admin/index
    * - or -
    * Since this controller is set as the default controller in
    * config/routes.php, it's displayed at http://example.com/
    *
    * So any other public methods not prefixed with an underscore will
    * map to /index.php/welcome/&lt;method_name&gt;
    * @see https://codeigniter.com/user_guide/general/urls.html
    */
         function __construct() {
          parent::__construct();
          $this-&gt;load-&gt;helper('url');
           $this-&gt;load-&gt;helper('form');
          $this-&gt;load-&gt;model('LoginModel');
         $this-&gt;load-&gt;library('session');
      }
        
        
      
   public function index()
   {
              if($this-&gt;session-&gt;userdata('is_logged_in')){
     redirect('package/packages');
          }else{
           $this-&gt;load-&gt;view('admin/admin'); 
          }
    
   }
            function __encrip_password($password) {
          return md5($password);
      } 
           /**
      * check the username and the password with the database
      * @return void
      */
          public function login()
   { 
        echo "hi"; exit;
    
  
    $user_name = $this-&gt;input-&gt;post('username');
    $password = $this-&gt;__encrip_password($this-&gt;input-&gt;post('password'));
  
    $is_valid = $this-&gt;LoginModel-&gt;validate($user_name, $password);
    
    if($is_valid)
    {
     $data = array(
      'user_name' =&gt; $user_name,
      'is_logged_in' =&gt; true
     );
     $this-&gt;session-&gt;set_userdata($data);
     redirect('package/package');
    }
    else // incorrect username or password
    {
     $data['message_error'] = TRUE;
     $this-&gt;load-&gt;view('admin/admin', $data); 
    }
   }
          
         
  
     
   
    
  
      /**
      * The method just loads the signup view
      * @return void
      */
  }</code></pre>
  </div>
  </div>
  </p>