[eluser]kirkaracha[/eluser]
Assuming URLs like example.com/blog/2011/07
In config/routes.php
Code:
$route['blog/(:num)/(:num)'] = 'blog/month/$1/$2';
$route['blog/(:num)'] = 'blog/year/$1/';
In controllers/blog.php
Code:
public $url_year;
public $url_month;
public function __construct() {
parent::__construct();
$this->url_year = $this->uri->segment(2,NULL);
$this->url_month = $this->uri->segment(3,NULL);
}
public function year(){
// do a query for entries that match the year
}
public function month(){
// do a query for entries that match the year and month
}