0

I am using https://github.com/EllisLab/CodeIgniter/wiki/CodeIgniter-2.1-internationalization-i18n, where I use it for multi-language support for website. I need to edit my routes to use the language parameters where I remove the method's name:

{domain}/{application}/{language}/{controller}/{method}/{parameter}
example: http://localhost/website/en/test/show/parameter

to

{domain}/{application}/{language}/{controller}/{parameter}
example: http://localhost/website/en/test/parameter

I set this in routes.php

$route['test/(:any)'] = "test/show/$1";

$route['default_controller'] = "home";
$route['404_override'] = '';    

$route['^(en|sk)/(.+)$'] = "$2";
$route['^(en|sk)$'] = $route['default_controller'];

Problem:

When I use:

http://localhost/website/en/test/show/parameter

this is working great. But I applied

$route['test/(:any)'] = "test/show/$1";

and now when I use

http://localhost/website/en/test/parameter

it is not working. It show me 404 Page Not Found.

Thank you for your suggestions/code.

Solution:

Figured out solution:

edit routes.php

$route['^(en|sk)/test/(:any)'] = "test/show/$2";
4

1 回答 1

0

解决方案:

想出解决办法:

编辑routes.php

$route['^(en|sk)/test/(:any)'] = "test/show/$2";
于 2013-10-30T15:35:31.430 回答