title: CodeIgniter force_download function does not work
body: <p>In the following code example, i am calling the download page. However, force_download does not work. There is no redirection, it stays on the same page because of i called the page as <code>index.php/sample/download</code>. Only the url is changing. But the download is not triggered. Also i can not call the page as direct <code>/sample/download</code>. Although i specify the required configuration for index.php (index_page), if i do not specify the download link as <code>/sample/index.php/sample/download</code>, it returns 404 error.</p>
  
  <p><strong>application/controller/Sample.php</strong></p>
  
  <pre><code>class Sample extends MY_Controller {
      public function __construct() {
          parent::__construct();
          $this-&gt;load-&gt;helper(array('form', 'url_helper', 'download'));           
          $this-&gt;load-&gt;model('Sample_model');
      }
  
      public function index() {
          $data = $this-&gt;getData();
          $this-&gt;load-&gt;view('sample/view', $data);
      }
  
      public function download() {
          $data = 'Here is some text!';
          $name = 'mytext.txt';
          force_download($name, $data);
      }
  }
  </code></pre>
  
  <p><strong>application/views/sample/view.php</strong></p>
  
  <pre><code>&lt;a href="&lt;?php echo base_url(); ?&gt;index.php/sample/download"&gt;Download file&lt;/a&gt;
  </code></pre>
  
  <p><strong>application/config/config.php</strong></p>
  
  <pre><code>$config['index_page']   = '';
  $config['uri_protocol'] = 'REQUEST_URI';
  </code></pre>
  
  <p><strong>application/config/routes.php</strong></p>
  
  <pre><code>$route['default_controller']    = 'Sample';
  $route['404_override']          = '';
  $route['translate_uri_dashes']  = FALSE;
  $route['sample']                = 'sample/index';
  $route['sample/download']       = 'sample/download';
  </code></pre>