title: CodeIgniter setting up routing properly
body: <p>I'm trying to setting up my codeigniter routing to make an authentication form for an admin panel, but the routing is not working. I'm a beginner with CodeIgniter and I think I'm missing something.</p>
  
  <p>In my server I put the CodeIgniter fiels inside  folder in my root directory, so it can be accessed like this:</p>
  
  <pre><code>/localhost/ci
  </code></pre>
  
  <p>In my config.php I set my base url and remove the index page to remove index.php:</p>
  
  <pre><code>$config['base_url'] = 'http://localhost/ci/';
  $config['index_page'] = '';
  </code></pre>
  
  <p>Also I have edited the .htaccess to remove the index.php like CodeIgniter documentation says, so it looks like this:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond $1 !^(index\.php|images|robots\.txt)
  RewriteRule ^(.*)$ /index.php/$1 [L]
  </code></pre>
  
  <p>Now, my routes config file looks like this. I set my default page and a route to my Auth controller:</p>
  
  <pre><code>$route['default_controller'] = 'auth';
  $route['404_override'] = '';
  $route['translate_uri_dashes'] = FALSE;
  $route['auth/login'] = "auth/login";
  </code></pre>
  
  <p>This is my Controller:</p>
  
  <p>class Auth extends CI_Controller {</p>
  
  <pre><code>function __construct() {
      parent::__construct();
      // load libraries
  }
  
  function index() {
      if (! $this-&gt;ion_auth-&gt;logged_in()) {
          // redirect them to the dashboard page
          redirect(base_url('auth/login'), 'refresh');
      } else {
          // show the dashboard page
          redirect(base_url('dashboard'), 'refresh');
      }
  }
  
  function login() {
      $this-&gt;load-&gt;view('login');
  }
  </code></pre>
  
  <p>When I enter in the web-browser <a href="http://localhost/ci/" rel="nofollow">http://localhost/ci/</a> it redirects me to <a href="http://localhost/ci/auth/login" rel="nofollow">http://localhost/ci/auth/login</a>, but then a 404 Not Found error ir raised. What am I missing? I'm a bit confused at this point, thanks.</p>