【问题标题】:codeigniter - internationalization i18n - 404 Page Not Foundcodeigniter - 国际化 i18n - 404 页面未找到
【发布时间】:2013-10-15 08:31:34
【问题描述】:

我正在使用https://github.com/EllisLab/CodeIgniter/wiki/CodeIgniter-2.1-internationalization-i18n,我将它用于网站的多语言支持。我需要编辑我的路线以使用我删除方法名称的语言参数:

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

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

我在 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'];

问题:

当我使用时:

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

这很好用。但是我申请了

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

现在当我使用

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

它不工作。它显示 404 Page Not Found。

感谢您的建议/代码。

解决方案:

想出解决办法:

编辑routes.php

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

【问题讨论】:

    标签: php codeigniter internationalization


    【解决方案1】:

    解决办法:

    想出解决办法:

    编辑routes.php

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-28
      • 1970-01-01
      • 1970-01-01
      • 2015-05-19
      • 1970-01-01
      • 1970-01-01
      • 2015-03-30
      • 2018-05-13
      相关资源
      最近更新 更多