I have a multilanguage website (spanish, english, french) in PHP which main’s language is english.
If $_SESSION['idm'] is set to ‘en’ it loads a file with the translations.
I want to set it up this way:
if the user language is spanish
www.mydomain.com and mydomain.com -> es.mydomain.com
www.mydomain.com/video.php?id=3 -> es.mydomain.com/video.php?id=3
if user language is french
www.mydomain.com and mydomain.com -> fr.mydomain.com
www.mydomain.com/video.php?id=3 -> fr.mydomain.com/video.php?id=3
if not any of the above
www.mydomain.com and mydomain.com -> en.mydomain.com
www.mydomain.com/video.php?id=3 -> en.mydomain.com/video.php?id=3
How do I do that, and, is this good SEO wise?
in PHP: