I have just finished a client’s website and now they want to have different languages.
At the moment the sites content is stored on tables in a MySQL db:
pages: seotitle, seodesc, smallHtml, fullHtml
products: ID, seotitle, seodesc, smallHtml, fullHtml
I was thinking a good way to do it would be to have an extra table:
- languages: ID, LanguageCode, language
Then modify the pages and products table to:
- pages: slug, seotitle, seodesc, smallHtml, fullHtml, languageCode
- products: ID, slug, seotitle, seodesc, smallHtml, fullHtml, languageCode
So I would be using a query like
SELECT * FROM pages WHERE slug = '$slug' AND language='$language'
Should I set $language
as a cookie or session?
Also, I am stuck on what to do as far as SEO goes. At the moment the site URL structure is /pages.php?slug=page-slug
. This gets rewritten by mod_rewrite to /pages/page-slug
.
So I was thinking of having /pages.php?slug=page-slug&code=languagecode
rewriting to /pages/page-slug/languagecode
. Same for products.
Would this be a good method or can you see it failing somehow?
If anyone has any better methods or links to resources I may have missed that would be much appreciated.
Thanks for reading.
EDIT/////
If I was to use this method http://en.kioskea.net/faq/596-change-the-language-of-your-website and change the language behind the scenes, without changing the URL structure how would Google handle this?