...

View Full Version : Help with SEO for multilingual website



AlexV
10-16-2008, 03:04 PM
Hello all!

I made a multilingual PHP website framework. The framework serve the HTML "container" (the visual template of the site) and the page serve the content (in the current language).

I use the following to determine the current language:
1) $_GET['lang'] if set.
2) $_SESSION variable if set.
3) $_COOKIE if set.
4) Default language (English).

The user can change the language anytime on any page.

All the languages are in the same file. For example, index.php can be served in English, French, German...

This setup is very easy to maintain since if you change the visual template (the container), all the pages of the site will be updated at once. Same thing with the content... For example, you set the content layout of index.php once and then edit the content for each language.

My setup has one problem... It's not very SEO oriented (yet). Since www.foo.net/index.php can be served in many languages, Google and friends only index my pages in the default language.

Now I want to implement SEO URLs. So far my system support language overrides: if the session is set to French and that you type index.php?lang=en the page will be served in English instead of French.

I would like to use something like:
www.foo.net/en/index.php
www.foo.net/fr/index.php

I know it's doable with .htaccess (I think) but I would like to know how to do it... I would like to avoid redirect things since I don't want to "break" the back button.

Many thanks for your thoughts/hints!

gnomeontherun
10-16-2008, 03:46 PM
http://www.skybyte.net/articles/mod_rewrite/

Here is a link with some information, I'm no expert with all of the ways to do it, but it should give you a start.

oesxyl
10-17-2008, 05:20 AM
Hello all!

I made a multilingual PHP website framework. The framework serve the HTML "container" (the visual template of the site) and the page serve the content (in the current language).

if you use apache this could help you:

http://httpd.apache.org/docs/2.2/content-negotiation.html

best regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum