title: Codeigniter with single controller error 404
body: <p>I'm quite a rookie with CodeIgniter, and as per title, I have troubles trying to setup a single controller for my application. It's a very simple static site with couple of pages like "home", "about" and so on...  </p>
  
  <p>I have this in my <code>routes.php</code> file:</p>
  
  <pre><code>$route['default_controller'] = "mycontroller";
  $route['404_override'] = '';
  $route['(:any)'] = "mycontroller/$1";
  </code></pre>
  
  <p>And this in <code>mycontroller.php</code> file:</p>
  
  <pre><code>// Home
  public function index()
  {
      $data['page'] = 'home';
      $this-&gt;load-&gt;view('template',$data);
  }
  
  // about
  public function about()
  {
      $data['page']  = 'about';
      $data['title'] = 'About Us';
      $this-&gt;load-&gt;view('template',$data);
  }
  </code></pre>
  
  <p>I'm working in a localhost environment, and the CI project is in this folder:</p>
  
  <pre><code>http://localhost/local/project/ci-tbs/
  </code></pre>
  
  <p>and I've specified it also in the <code>config.php</code> file for the <code>base_url</code> parameter.</p>
  
  <p>Now what I'd expect pointing the browser to </p>
  
  <pre><code>http://localhost/local/project/ci-tbs/about
  </code></pre>
  
  <p>is to find the "About Us" page, instead I got a 404 error. Pointing to the base address corectly gives me the "Home" page. </p>
  
  <p>What am I doing wrong?</p>
  
  <p>Is it sensed to use a single controller istead of 1 per page? I'd totally do that in a quick way to fix, still I'm quite baffled by the fact that I can't understand what I am doing wrong and why it's not working. I'd like to simple set everything in one controller, one method per page. </p>
  
  <p>I've already seen this topic asked here in SO, like using regular expressions in the route <code>$route['(.*)'] = "mycontroller/$1";</code>, but nothing really worked for my case wich I think is quite basic (so basic I'm sure my error is so gross that it will be quite embarrassing :P ).</p>
  
  <p>Additional info: </p>
  
  <p>I have in the folder an .htaccess file picked <em>as is</em> from the Html5 Boilerplate, tried with and without it but 404 is always there. I'm using XAMPP as local environment.</p>
  
  <hr>
  
  <h2>For answer</h2>
  
  <p>As mentioned by @Vincent Decaux in the answer, the deal to fix this was to add index.php in the url, the other interesting part is</p>
  
  <blockquote>
    <p>Create your .htaccess file to "hide" index.php</p>
  </blockquote>
  
  <p>This way I've resolved another small issue for the pages with missing findings for the assets files, so I used the following rule in the .htaccess file, redirecting all requests to the index.php file and excluding files in assets folder and images, along with robots.txt as suggested here <a href="https://stackoverflow.com/a/11846150/1262357">https://stackoverflow.com/a/11846150/1262357</a></p>
  
  <pre><code>RewriteEngine on
  RewriteCond $1 !^(index\.php|assets|images|robots\.txt)
  RewriteRule ^(.*)$ index.php/$1 [L]
  </code></pre>
  
  <p>hope this helps others with same problems I had!</p>