title: CodeIgniter pagination won't go past first page
body: <p>I have a blog page of posts that I am trying to paginate using CodeIgniter. The numbering and limiting seem to be working fine, except I keep getting a 404 when I try to travel to another page.</p>
  
  <p>The strange thing is the normal culprits that cause this issue are correct. The baseUrl and the uri_segment.</p>
  
  <p>My controller looks like this:</p>
  
  <pre><code>$config                = array();
  $config["base_url"]    = $this-&gt;config-&gt;site_url("/blog");
  $config["total_rows"]  = $this-&gt;blog_model-&gt;count();
  $config["per_page"]    = 2;
  $config["uri_segment"] = 2;
  $config["num_links"] = round($config["total_rows"] / $config["per_page"]);
  
  $config['use_page_numbers'] = TRUE;
  
  $this-&gt;pagination-&gt;initialize($config);
  $page = ($this-&gt;uri-&gt;segment(2)) ? $this-&gt;uri-&gt;segment(2) : 0;
  
  $this-&gt;load-&gt;view('blog', array(
      'user' =&gt; $this-&gt;user,
      'blog' =&gt; $this-&gt;blog_model-&gt;loadPosts($config['per_page'], $page),
      'links' =&gt; $this-&gt;pagination-&gt;create_links(),
      'footer' =&gt; $this-&gt;blog_model-&gt;loadFooter()
  ));
  </code></pre>
  
  <p>And then in my model I am grabbing the posts</p>
  
  <pre><code>public function loadPosts($limit, $start)
  {
      $this-&gt;db-&gt;limit($limit, $start);
      $this-&gt;db-&gt;order_by("date", "desc");
      //this loads the contact info
      $query = $this-&gt;db-&gt;get('entries');
      return $query-&gt;result();
  }
  </code></pre>
  
  <p>My full URL is <code>www.mysite.com/blog</code> and then with the pagination it appears as <code>www.mysite.com/blog/2</code>.</p>
  
  <p>For the base_Url I have also tried <code>base_url() . "/blog";</code>.</p>
  
  <p>And I have tried setting the uri_segment to 1 and 3, but nothing seems to work.</p>
  
  <p>As well I have tried playing around with the routing and have added just to see if it would do anything:</p>
  
  <pre><code>$route['blog/(:num)'] = 'blog/$1';
  </code></pre>