title: CodeIgniter Url Rewrite (language dependent)
body: <p>So, i have my .htaccess, my controllers, everything is going fine. I added localization, so now i have Portuguese(Default), English and Italian.<br>
   I am using the _lang files in the appplication/languages directory, i am using session->userdata('lang') and everything works fine.
  My controllers are named with portuguese words, after the top menu. What i'm looking for is:<br>
  to rewrite my url, changing the name of the controller, depending on the session->userdata('lang').<br>
  Is this even possible? how?  </p>
  
  <p>Thank you</p>
  
  <p>So i am trying, as InFog suggested, in the routes file:  </p>
  
  <pre><code>if ($this-&gt;session-&gt;userdata('lang') == 'english') { 
      $route['novidades/([a-z]+)'] = 'news/$1'; 
  }
  </code></pre>
  
  <p>but i just get a blank screen when i open the application.<br>
  And i've tried it without the if clause, and nothing happens, when i go to   </p>
  
  <blockquote>
    <p><a href="http://localhost/myapp/novidades" rel="nofollow">http://localhost/myapp/novidades</a></p>
  </blockquote>
  
  <p>the url stays the same</p>