3

I am currently working on a website that is available in multiple languages. I put some effort in atomatically detecting the users preferred language. This itself is working great. I also offer language buttons to change the language of the site. The URL does not change. I save the language settings with a PHP session. This is working great! But Google just sees the default language (which is English). This is because the buttons for changing the language are inside a form wich sends a POST request.

To summarize it my site does not change the URL when changing the language. My idea to tell Google that it has several different languages is using hreflang tags which will point to the current page but the domain gets a subsdomain with the current language.

Example: (URL: http://example.com/)

<link rel="alternate" hreflang="en" href="http://en.example.com/">
<link rel="alternate" hreflang="de" href="http://de.example.com/">

When visiting http://en.example.com/ or http://de.example.com/ these sites redirect back to http://example.com/ to make sure the URL stays the same.

Will Google properly index my pages when I do this?

  • 1
    If you add your site to Google Webmaster Tools they will flag up any issues with rel="alternate" hreflang=". (such as missing return tags)So you might be able to tell if Google is reading it in there. – Max Sep 4 '14 at 23:38
3

You need to have separate URLs for Google to be able to index them separately. Using the same URLs for multiple languages won't work. You can dynamically serve the content on a single URL, but the individual language content needs to be on separate URLs too.

  • Ok. Tank you. Since I wanted to get rid of the cookies anyways I now have a good reason to do so. – BrainStone Sep 11 '14 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.