Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Routing using non-english characters! #705

Closed
nikosv opened this Issue · 4 comments

3 participants

@nikosv

Back in codeigniter version 1.7.2 i used to edit route.php in order to route non-english character URLs to the appropriate english character controller (for SEO purposes).

I have noticed that this was no longer available since version 2.0 of codeigniter. I am not sure if this is a bug or a feature.

@ericbarnes

Can you give an example of a route that used to work that doesn't any more?

@nikosv

sure! Here is an example:

in route.php:
$route['εστιατορια'] = "restaurants";

in order for this to work in 1.7.2 i also had to add the greek characters to the permitted uri chars

$config['permitted_uri_chars'] = "αάβγδεέζηήθιίϊκλμνξοόπρσςτυύφχψωώΑΒΓΔΕΖΗΘΙΪΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ a-z 0-9~%.:_-";

or allow all

$config['permitted_uri_chars'] = '';

in version 1.7.2 whenever i add a route without changing the permitted_uri_chars i get an error regarding the allowed characters. In version 2.x, on the other hand i get an error "that a controller with the specific name was not found". It is like the route.php is completely ignored when it contains a route with greek characters.

@nikosv

Here are some more info that solve the problem.
There is something going on with the url encoding.
while $route['εστιατορια'] = "restaurants"; used to work in versions 1.7.x
in version 2.x you should write $route[urlencode('εστιατορια')] = "restaurants";

so.. this is probably a feature and not a bug.

@narfbg
Owner

Might be related to #388.

@narfbg narfbg referenced this issue from a commit
@narfbg narfbg Fix issues #388 & #705
(thanks to @sourcejedi, PR #1326 for pointing inconsistencies with RFC2616
9dd2dbb
@narfbg narfbg closed this
@nonchip nonchip referenced this issue from a commit in nonchip/CodeIgniter
@narfbg narfbg Fix issues #388 & #705
(thanks to @sourcejedi, PR #1326 for pointing inconsistencies with RFC2616
eb43188
@narfbg narfbg referenced this issue from a commit
@narfbg narfbg Fix #3593
Revert "fixes" for #167, #388, #705 (also #1326) as it turns out
URL-decoding isn't compliant with the CGI/1.1 specification.

RFC 3875: http://www.faqs.org/rfcs/rfc3875.html
0ae4e6c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.