Welcome Guest, Not a member yet? Register   Sign In
Problem with route and URI Language code
#1

[eluser]deck1[/eluser]
Hi,

I'm having problems with the following route:

Code:
$route["([a-z]{2}(?:-[A-Z]{2})?/?)?(.*)"] ='$2';

I want urls with language code in the first segment, but that code may be "en" or "en-US" or nothing.

It works ok for the following URLs:
http://www.domain.com/
http://www.domain.com/en
http://www.domain.com/en/
http://www.domain.com/en/controller/...
http://www.domain.com/en-US
http://www.domain.com/en-US/
http://www.domain.com/en-US/controller/...


But fails (returns 404 page) with:
http://www.domain.com/controller/...


I have tried almost everything but i don't get it to work.

any suggestions?

Thanks in advance.


Messages In This Thread
Problem with route and URI Language code - by El Forum - 04-21-2008, 03:48 AM
Problem with route and URI Language code - by El Forum - 04-21-2008, 04:25 AM
Problem with route and URI Language code - by El Forum - 04-21-2008, 04:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB