Best structure for multilingual site

Discussion in 'PHP' started by stephan2307, Jun 15, 2012.

  1. #1
    Hi,

    I am setting up a website in multiple languages.

    for the development I simply store the language to use in a session variable. However I know this is not good for search engines.

    So I was wondering what the best way to do this.

    I had 2 ideas

    1. subfolder http://www.mydomain.com/en/PAGENAMESGOHERE

    or

    2. subdomain http://en.mydomain.com/PAGENAMESGOHERE

    Which one is the better one? Or is there another option??

    Thanks for any advice.
     
    Solved! View solution.
    stephan2307, Jun 15, 2012 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    i should do none of the above, instead you should use cookies, if no cookie is detected you should generate your default language, offer in the header clickable links to other languages and set them in a cookie so you can change content! :)
     
    EricBruggema, Jun 15, 2012 IP
  3. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
  4. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #4
    I didn't really ask about how to detect the correct language. I asked how to structure the site the best. And to have the same url for various languages is bad and can confuse search engines.
     
    stephan2307, Jun 15, 2012 IP
  5. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #5
    stephan2307, Jun 15, 2012 IP
  6. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
  7. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
  8. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #8
    ok after reading quite a bit about this I have decided that I will opt for the subdomain route.

    main domain will be in english and all other languages will be as subdomains. then giving the option to change the language where they will simply redirected to another subdomain or main site. I think that should work well
     
    stephan2307, Jun 15, 2012 IP
  9. #9
    Use sub-folders such as /es/ /fr/ etc.
     
    dcristo, Jun 15, 2012 IP
  10. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #10
    any particular reason to use subfolder rather than subdomain?
     
    stephan2307, Jun 15, 2012 IP
  11. dcristo

    dcristo Illustrious Member

    Messages:
    19,797
    Likes Received:
    1,201
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    5
    #11
    It's better for SEO because it's on the main domain.
     
    dcristo, Jun 15, 2012 IP
  12. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #12
    I see.

    Thanks.
     
    stephan2307, Jun 15, 2012 IP
  13. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #13
    I have set it all up now. Works like a treat. :D
     
    stephan2307, Jun 15, 2012 IP
  14. richardm55

    richardm55 Active Member

    Messages:
    762
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    65
    #14
    I also think it natural and better for SEO using subfolders instead of subdomains. Why? Because it it still the same website with the same content, only languages are different.
     
    richardm55, Jun 15, 2012 IP