CodeIgniter Forums
Translateable URL - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Translateable URL (/showthread.php?tid=66365)



Translateable URL - drusnac19 - 10-15-2016

Hi guys! What is the best way to build translateable URL? 

I could use this way (by routing):

Code:
//english
$route['en/article/(:any)'] = 'artice/view/$1';

//romanian
$route['ro/articol/(:any)'] = 'artice/view/$1';

But if I my website is set to english, I still can acces the link from romanian, so i need to check if the URL correspond to lang set, otherwise to show 404. I also want to keep my texts language in one place (languages folder), not to make them in routes.php


RE: Translateable URL - jlp - 10-15-2016

Here's what I would do ... http://comp4711.jlparry.com/display/lesson/basic07 (the bit on remapping for localization)