4

I am working on a cms project which will be used to publish news sites. I am using i18n plugin for multilingual issues. the problem is at routing. I have module called news and method page in it and route is set as

$route['page/test'] = 'news/page/1';

this works without problem when i go to

http://localhost/site/page/test

problems begin when i start using i18n localization plugin. then it only works with this url:

http://localhost/site/en/news/page/test

I want the url to be wiout the news segment. What can I do to solve this? Thanks in advance.

S. M. Shahinul Islam
  • 2,780
  • 4
  • 36
  • 68

2 Answers2

0

This will work on any controller, with or without a language string

$route['^([a-z]{2})/(.*)'] = '$2';
$route['^([a-z]{2})'] = $route['default_controller'];
FDisk
  • 8,493
  • 2
  • 47
  • 52
0

Looks normal to that it don't work anymore with the route cause it is missing the "/en/"

Did you try to put :

$route['en/page/test'] = 'news/page/1';

or

$route['en/page/test'] = 'en/news/page/1';

(I don't know the i18n plug)

If it works the solution might be in using a wildcard:

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

or

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

(again i don't know the plug i18n plug works)