I want to create a page, which I will be able to browse like this: /page/5.
I have created a page.php controller and I can view this page, here is its content:
class Page extends CI_Controller {
public function __construct() { parent::__construct(); } public function index() { $this->load->view('template/header'); $id = $this->uri->segment(2); $this->load->view('template/middle', array('id' => $id)); $this->load->view('template/footer'); }}
The problem is that I cant reach the page number from the uri.
To be clear:
This is reachable: index.php/page.
But at this url, I'm getting the 404: index.php/page/5
I know I can make another controller function to view the page like this /index.php/page/id/5, but I want it be be accessable via the index function.
Is that possible?