title: Why redirect function in CodeIgniter not working?
body: <p>I have a really weird problem. I have been using CI for more than 2 years and it's the first time I found this kind of problem. I found that the redirect function is not working properly. I already load the url helper in autoload.php.</p>
  
  <pre><code>$autoload['helper'] = array('url','html','form','file');
  </code></pre>
  
  <p>What I want to do is to redirect the users to a controller if they call admin controller.</p>
  
  <pre><code>class Admin extends CI_Controller {
     function index(){
        redirect('secure');
     }
  }
  </code></pre>
  
  <p>But what happen is the page redirected to the base_url. I've tried adding the second parameter of redirect with refresh or location but the result is just the same. It also happens to all redirect function in other controller. Can anyone tell me what the cause of this problem to happen?</p>
  
  <p>EDIT:
  For additional information that might be helpful for finding the problem, here I put the code of the routes.php.</p>
  
  <pre><code>$route['default_controller'] = "frontpage";
  $route['404_override'] = 'errors/page_missing';
  $route['admin'] = 'secure';
  </code></pre>