Welcome Guest, Not a member yet? Register   Sign In
Routing issues. Multiple routing
#1

[eluser]Unknown[/eluser]
Hi,

I am making a site with multi language support. For the same purpose i am using a custom MY_Language library that is inserting a 2 letter code after the URL for the language.

In the config/routes.php file i added this code to remove the language code from the URL
Code:
$route['(\w{2})/(.*)'] = '$2';
$route['(\w{2})'] = $route['default_controller'];

This code is working just fine. But now i am unable to provide any more routes. Like, for example, I also want this route to be used
Code:
$route['captcha/(:any)'] = "captcha/index";

This route enable me to redirect captcha/0.3425 to captcha/index. Unfortunately, this is not working. I even tried this code
Code:
$route['(\w{2})/captcha/(:any)'] = "captcha/index";

Kindly help me out...

Amit.
#2

[eluser]Unknown[/eluser]
Also, if i put
Code:
$route['(\w{2})/captcha/(:any)'] = "captcha/index";
before [code]$route['(\w{2})/(.*)'] = '$2';
$route['(\w{2})'] = $route['default_controller']; [\code]

the problem seems to be gone... But is [code]$route['(\w{2})/(.*)'] = '$2';[\code] not supposed to do the same?




Theme © iAndrew 2016 - Forum software by © MyBB