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";