title: CodeIgniter Tutorial about Static Pages
body: <p>I started to try the first tutorial example on <a href="http://ellislab.com/codeigniter%20/user-guide/tutorial/static_pages.html" rel="nofollow">http://ellislab.com/codeigniter%20/user-guide/tutorial/static_pages.html</a>.</p>
  
  <p>I always get the Page Not Found Problem!
  I have read a lot of articles about to solve the problem. But it doesn't matter how often I try the solutions in different forums, it's not working!</p>
  
  <p>Can someone please let me know where my bugs are?</p>
  
  <p>So these are some files I tried:</p>
  
  <p><strong>My routes.php in application/config</strong></p>
  
  <pre><code>$route['default_controller'] = "pages/view";
  $route['404_override'] = '';
  $route['(:any)'] = 'pages/view/$1';
  </code></pre>
  
  <p><strong>My pages.php in application/controllers</strong></p>
  
  <pre><code>&lt;?php
     class Pages extends CI_Controller{
      public function view($page = "home")
      {
        if ( ! file_exists('application/views/pages/'.$page.'.php'))
        {
          // Whoops, we don't have a page for that!
          show_404();
        }
  
        $data['title'] = ucfirst($page); // Capitalize the first letter
  
        $this-&gt;load-&gt;view('templates/header', $data);
        $this-&gt;load-&gt;view('pages/'.$page, $data);
        $this-&gt;load-&gt;view('templates/footer', $data);
      }
  }
  </code></pre>
  
  <p>My home.php and about.php are on <strong>application/views/pages/</strong>
  and the header.php and the footer.php are on <strong>application/views/templates/</strong></p>
  
  <p>Thank you very much!</p>