title: CodeIgniter URI routing (dynamic, multilingual)
body: <p>I'm trying to redirect all routs to one main controller. Here is my routes.php</p>
  
  <pre><code>$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";
  </code></pre>
  
  <p>I need language id to be passed with every link (like: <a href="http://site.com/en/hello-world" rel="noreferrer">http://site.com/en/hello-world</a>)</p>
  
  <p>Here is my main controller:</p>
  
  <pre><code>class Main extends Controller
  {
      function __construct()
      {
          parent::Controller();       
      }
  
      function index($page_type=false, $param=false) 
      {
          die($page_type.' | '.$param.'| Aaa!');  
      }
  } 
  </code></pre>
  
  <p>I want to check if predefined file type exists (like: <a href="http://site.com/en/archive/05-06-2010" rel="noreferrer">http://site.com/en/archive/05-06-2010</a> - here predefined type would be archive) then do something. If not then search in the database for slug. If not found then go to 404.</p>
  
  <p>The problem is that I can't get index function parameters ($page_type, $param). Thanks for help.</p>