Welcome Guest, Not a member yet? Register   Sign In
Problem with route prefix for wildcard uri (language code in this case)
#1

[eluser]Unknown[/eluser]
Hello, this is my first post on the CI forum!

I'm having issues with setting up a prefix for my routes (CI 2.0.2). Here's my setup in /application/config/routes.php:

Code:
$route['default_controller'] = "pages";

// prefix, i.e. 'en'
$route['(\w{2})/(.*)'] = '$2';
$route['(\w{2})'] = $route['default_controller'];

$route['people'] = "people"; // account controller

// wildcards/slugs, i.e. /en/about
$route['(\w{0,255})'] = "pages/read/$1";

Now
Code:
/en/pages/read/about
displays fine, however
Code:
/en/about
displays <b>"Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid"</b>

Why is that?

PS. the reason I put this in the bug-forum is that this is taken from my previous project (earlier CI version), and in that case it worked fine.




Theme © iAndrew 2016 - Forum software by © MyBB