Routing in codeigniter doesn't work with non e

2019-06-07 01:17发布

问题:

I'm trying to create a route that contains non English characters. I'm using something like:

$route[rawurlencode('stringWithNonEnglishCharacters')] = "controller/method";

On my local server this works just fine but when I upload it to the server, for some reason it works only with english characters. Any idea of what I'm doing wrong or what I need to config?

回答1:

I used ASCII instead.

Sample

$route['%E0%B8%9A%E0%B8%97%E0%B8%84C'] = 'controller/method';

You will see the URL in ASCII format when copying URL and paste it into the text editor.

Or

$route[urlencode('Your languages String')] = "controller/method";