title: Codeigniter Paging is Showing Empty Page after Page1
body: <p>I am trying to create pagination in my project. I have successfully created the pagination on page 1. Its showing me 8 Records on it. But when i click on Page 2, it gives the <code>Page Not found</code> Page. </p>
  
  <p>The Url on first page is</p>
  
  <blockquote>
    <p>localhost/pagination/index.php/pagination/pagination_rows</p>
  </blockquote>
  
  <p>The Url on Second page shows this only,</p>
  
  <blockquote>
    <p>localhost/pagination/pagination/8</p>
  </blockquote>
  
  <p>I have written the following code to accomplish this.</p>
  
  <blockquote>
    <p><strong>Model</strong></p>
  </blockquote>
  
  <pre><code>    public function courses_list($limit, $start)
      {
          $this-&gt;db-&gt;limit($limit, $start);
          $this-&gt;db-&gt;select('*');
          $this-&gt;db-&gt;from('courses');
          $this-&gt;db-&gt;order_by('in_semester');
  
          $query=     $this-&gt;db-&gt;get();
  
          return $query-&gt;result();
          }
  </code></pre>
  
  <blockquote>
    <p><strong>Controller</strong></p>
  </blockquote>
  
  <pre><code>    public function pagination_rows() {
      $config["base_url"] = base_url() . "pagination";
     // $config["total_rows"] = $this-&gt;Countries_Model-&gt;record_count();
     $config["total_rows"] = 100;
      $config["per_page"] = 8;
      $config["uri_segment"] = 2;
  
      $this-&gt;pagination-&gt;initialize($config);
  
      $page = ($this-&gt;uri-&gt;segment(2))? $this-&gt;uri-&gt;segment(2) : 0;
  
      $data["courses_list"] = $this-&gt;loginmodel-&gt;courses_list($config["per_page"], $page);
  
      $data["links"] = $this-&gt;pagination-&gt;create_links();
  
      $this-&gt;load-&gt;view("courses_list", $data);
      }
  </code></pre>
  
  <blockquote>
    <p><strong>View</strong></p>
  </blockquote>
  
  <p>
  
  <pre><code>foreach ($courses_list as $courses_records)
  {
      $course_id=         $courses_records-&gt;CourseId;
  
      $course_name=       $courses_records-&gt;CourseName;
      $credit_hours=      $courses_records-&gt;CreditHours;
      $in_semester=       $courses_records-&gt;in_semester;
  
  
  ....
  ...
  ..
  }
  
  
  &lt;div style="text-align:center"&gt;&lt;?php echo "Links  ".$links; ?&gt;&lt;/div&gt;
  </code></pre>