Multi-Language Website with multi-country SEO friendly urls

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
Paul Arnold
Forum Contributor
Posts: 141
Joined: Fri Jun 13, 2008 10:09 am
Location: Newcastle Upon Tyne

Multi-Language Website with multi-country SEO friendly urls

Post 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.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

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

Post 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.
Paul Arnold
Forum Contributor
Posts: 141
Joined: Fri Jun 13, 2008 10:09 am
Location: Newcastle Upon Tyne

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

Post 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.
Paul Arnold
Forum Contributor
Posts: 141
Joined: Fri Jun 13, 2008 10:09 am
Location: Newcastle Upon Tyne

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

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

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

Post 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.
(#10850)
Paul Arnold
Forum Contributor
Posts: 141
Joined: Fri Jun 13, 2008 10:09 am
Location: Newcastle Upon Tyne

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

Post by Paul Arnold »

Hmm, that's not a bad shout either.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

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

Post by josh »

Post Reply