Welcome Guest, Not a member yet? Register   Sign In
Routing + Language problem - Not routing correctly
#1

[eluser]Mauricio de Abreu Antunes[/eluser]
Hello,

Here i'm again but this time i have a routing problem.

My routes.php looks like:

Code:
$route['default_controller'] = "home";
$route['^(en|pt)/(.+)$']     = "$2";
$route['404_override']       = '';

So, i added the following line:

Code:
$route['noticias/(:any)']    = 'noticias/visualiza';

My intention is redirect any page with "noticias/(:any)" to "noticias/visualiza", so i can use the slug to show the proper new with a slug like localhost/percutz/pt/noticias/help-me-to-route because i route to visualiza controller and there i can use uri segment to use the slug in my query.

But my pages have translation as you can see above (pt).
It could be english too. But when I click on the referenced link, i got Request Not Found (404).

How can I solve this problem?

I wish I could use a regular expression in my routes, but I don't know how to get it done.






Theme © iAndrew 2016 - Forum software by © MyBB