CodeIgniter Forums
[SOLVED] routing woes - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: [SOLVED] routing woes (/showthread.php?tid=26504)



[SOLVED] routing woes - El Forum - 01-15-2010

[eluser]MV[/eluser]
I have been stuck with routing for days:

How can i do this:

http://www.site.com/en/section1/...
http://www.site.com/es/....

I want to check on routes to see if that first language segment exists. If it does, we get on with the work, otherwise it loads a particular controller.

Also, i want to avoid this from working:

http://www.site.com/section1

All my urls have to have the first language segment - site sections will react to the different language/first segment.

Been fooling around with all types of routes but to no avail. :-P

Any links to sites with routing examples are highly appreciated, since the manual is very small on this.

Thanks


[SOLVED] routing woes - El Forum - 01-15-2010

[eluser]Cro_Crx[/eluser]
This might help http://ellislab.com/forums/viewthread/101790/P0/

Something like this would probably work:

Code:
$route['(en|es)/(:any)'] = "$2/$1";



[SOLVED] routing woes - El Forum - 01-15-2010

[eluser]MV[/eluser]
Thank you, Cro_Crx. Already reading the link and trying the suggestion..and trying to understand it also. Somehow i cant get my head wrapped around the routing business. Must be getting old. :-P