Problem with cyrillic characters in friendly url

前端 未结 3 1510
旧巷少年郎
旧巷少年郎 2021-01-21 09:53

Here\'s the thing. I have friendly urls like

http://site.com/blog/read/мъдростта-на-вековете

http://site.com/blog/read/green-apple

3条回答
  •  深忆病人
    2021-01-21 10:32

    The above answers are ok, but if you want to use routing with cyrillic it isn't enough. For example if you have http://site.com/блог/статия/мъдростта-на-вековете you will have to do something like this:

    In config/routes.php: $route['блог/статия/(:any)'] = "blog/article/$1";

    In system/core/URI.php , in the function _explode_segments(), you can change

    $val = trim($this->_filter_uri($val));
    

    to

    $val = urldecode(trim($this->_filter_uri($val)));
    

    This will solve the above problem plus controllers and functions.

提交回复
热议问题