Page 1 of 1

Multi-Language Website with multi-country SEO friendly urls

Posted: Thu Sep 17, 2009 9:11 am
by Paul Arnold
We're about to build a new job recruitment site for a client and they want, not only multi-language support, they also want the URLs to bu multi-language.

For example:

The English url for a page might be http://www.########.com/job_search

The equivalent French url would be http://www.########.com/travail_recherche (I did this on a translation website so forgive me if it's not right. The client will be providing us with these).

The multi-language thing I'm fine with (Cookies, Sessions etc). No Problem.

Does anyone know of a way I can handle the urls without creating a new controller for each language?
They're going to need to be able to add new languages and have them work the same way.

Re: Multi-Language Website with multi-country SEO friendly urls

Posted: Thu Sep 17, 2009 9:30 am
by onion2k
I can't help with the controller question because my controllers tend to use a map to translate the incoming parameters to the correct view (so any view can have as many paths to it as I want) rather than basing it on a filename or something, but I can assure you that using a single .com for all the languages isn't going to help with Google. You need to buy the proper domain names ... .fr for France, .de for Germany, etc. People outside of the UK and USA are much, much more likely to click on a site with their own TLD, and Google will rank your site higher on google.fr if it has a .fr domain.

EDIT: Could you simply make a rewrite rule along the lines of;

RewriteRule ^/travail_recherche /job_search [NC,L]

As far as your controller would be concerned there'd only be one language that way. If they added a new language you'd need to update the .htaccess rules but that could easily be done programmatically. It is only a text file after all.

Re: Multi-Language Website with multi-country SEO friendly urls

Posted: Thu Sep 17, 2009 10:20 am
by Paul Arnold
That was an idea that I had of how to do it (the rewrite rules).
I guess it would just be a case of adding one for each function that we write for each language.
I'm not sure how much overhead that would add. I maybe need to look into this.
I was wondering if anyone would have any other ideas but when I think about it, this could well be the smplest way to do it.

As regards the TLDs, I believe they're registering these. I think they already have http://www.########.fr.

Re: Multi-Language Website with multi-country SEO friendly urls

Posted: Mon Sep 21, 2009 4:12 am
by Paul Arnold
One of our other developers has just come up with a great way of doing this.
We're going to build all of the functions in English, but have controllers in each language that just extend the base English controller. The individual language controllers will obviously be selected based on cookies / sessions.

Most of the work will be done by the models so the controllers will basically just handle the URL mapping.

Re: Multi-Language Website with multi-country SEO friendly urls

Posted: Mon Sep 21, 2009 3:28 pm
by Christopher
Wouldn't it be easier to just have routes that are aliases to actual controllers. It seem like if you have to create a new controller for every one of them, it would be easier to just create a route for each.

Re: Multi-Language Website with multi-country SEO friendly urls

Posted: Tue Sep 22, 2009 3:21 am
by Paul Arnold
Hmm, that's not a bad shout either.

Re: Multi-Language Website with multi-country SEO friendly urls

Posted: Tue Sep 22, 2009 3:46 pm
by josh