I am trying to redirect all routes to one main controller. Here are my .php routes
$route['default_controller'] = "main";
$route['scaffolding_trigger'] = "";
//$route['(\w{2})/(.*)'] = '$2';
//$route['(\w{2})'] = $route['default_controller'];
$route['(en|ge)/(:any)'] = $route['default_controller']."/index/$1";
$route['(:any)'] = $route['default_controller']."/index/$1";
I need the language identifier to be passed with every link (e.g .: http://site.com/en/hello-world )
Here is my main controller:
class Main extends Controller
{
function __construct()
{
parent::Controller();
}
function index($page_type=false, $param=false)
{
die($page_type.' | '.$param.'| Aaa!');
}
}
I want to check if a predefined file type exists (for example: http://site.com/en/archive/05-06-2010 - here the predefined type will be an archive), then do something. If not, then search the database for slug. If not found, go to 404.
The problem is that I cannot get the parameters of the index function ($ page_type, $ param). Thanks for the help.