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