Internationalisation, Clean URLs and Google page ranking. |
[eluser]Rhoel[/eluser]
Before coming to CI, I coded with PHP and SMARTY. My preferred technique for multilingual sites was to code www.sitename.com/en/home/, www.sitename.com/fr/home/ etc. The advantage over sessions was the fact every page registered with Google. With CI, the first entery in the URL points to a controller and not a detectable launguage switch. Unless I have misinterpreted the i18n and routing, this is not changeable. So mu question is 'Is there a plug-in or different dynamic routing approach which will enable me to use /en/, /fr/, /jp/ to preserve the Google ranking?' Thanks for any pointers on the right approach. Rhoel
[eluser]LuckyFella73[/eluser]
Welcome to CI forums! I recommend you this nice library - it does exactly what you are looking for: http://maestric.com/doc/php/codeigniter_i18n
[eluser]LuckyFella73[/eluser]
Glad I could help you finding a solution! Quote:You’re a hero, spot on the mark.In this case it's more Jérôme Jaglale we have to be thankfull to for writing this library ![]()
[eluser]Rhoel[/eluser]
[quote author="LuckyFella73" date="1312291726"]Glad I could help you finding a solution! Quote:You’re a hero, spot on the mark.In this case it's more Jérôme Jaglale we have to be thankfull to for writing this library ![]() Point taken, Hail Jérôme Jaglale :-) We work with English and Khmer (the Cambodian national language) on a daily basis ... I now have a request for Japanese as well. Not having to sort out this library will be a huge burden off my back. Thanks for the very fast feedback, it's appreciated. Rhoel
[eluser]benjamincurrie[/eluser]
The above library looks great and while not trying to devalue the author's work, I'll post another solution I came up with for anyone else interested. I had a project that required multi-lingual support with translated URL's, eg: mysite.com/home (home page in English) mysite.com/accueil (home page in French) For those who take SEO seriously, having a URL that uses your keywords is a big deal and my employer at the time wanted the keywords in the URL for every language. This does require a config file to keep track of controller and function translations, for those who don’t wish to maintain translations it reverts to URL’s like this: mysite.com/fr/home There is also an option to use a query string: mysite.com/home?lang=fr I’ve put the project up on Github and would love some feedback as I have only tested in my own environments so far. Feel free to fork the project and implement your own methods, hopefully we can get a fairly expansive library happenning together. https://github.com/benjamincurrie/CodeIg...age-Switch A lot of people seem to want to use cookies for storing user language preference, however I don’t believe this is the best practice for search engine crawlers. Will eventually get to supporting this method too (as well as subdomain). Ben |
Welcome Guest, Not a member yet? Register Sign In |