3

Couldn't find a similar question here, and seems kinda simple, so sorry if this has been asked before.

I'm developing a site with dual language, setup in the following format:

http://www.example.com/en/ ~ English Site
http://www.example.com/pl/ ~ Polish Site

Assuming the client would eventually like to share the site url as...

http://www.example.com/

... without addition language sub-directory, I will implement a .htaccess redirect, probably based on UA language.

Question: Will this affect SEO at all? Are there any 'best practices' here?

3

In each language-specific page, ensure you have the language set. Either use the <meta http-equiv="content-language" content="ll-cc"> tag in the section of your page, where "ll-cc" stands for the culture code of the language and country/region the content applies to, or use the lang="ll-cc" attribute on either the <html> or the <title> tag like <html lang="en-gb">. Then use hreflang tags to point back to the version in the alternate language.

For the landing page you should use an "x-default" to indicate it as a language/country selector or auto-redirecting homepage. So, you may end up with something like:

Default Homepage:

<html lang="x-default">
  <link rel="alternate" href="https://www.example.com/en/" hreflang="en">
  <link rel="alternate" href="https://www.example.com/pl/" hreflang="pl">

English Homepage:

<html lang="en">
  <link rel="alternate" href="https://www.example.com/pl/" hreflang="pl">
  <link rel="alternate" href="https://www.example.com/" hreflang="x-default">

Polish Homepage:

<html lang="pl">
  <link rel="alternate" href="https://www.example.com/en/" hreflang="en">
  <link rel="alternate" href="https://www.example.com/" hreflang="x-default">
  • 1
    In my case, there is no default landing page, there are only html pages within each sub-directory. Should I create an empty redirecting landing page with x-default lang attribute? I was trying to avoid unnecessary round trips by using the htaccess to catch and direct the initial page load. Is that not wise? – asimovwasright Nov 10 '15 at 13:09
  • 1
    Thanks Nickolas, actually all pages have js functions to do just that. My question is only how to handle the landing page, since there is no /index.html - only /en/index.html or /pl/index.html. The sites are perfectly bidirectionally linked as per googles recommendations. – asimovwasright Nov 10 '15 at 14:02
  • 1
    I'll do my best to not lead you astray. In reference to your first comment: Yes, if it were me, I would also do what @Andrew suggested and use an "x-default" to indicate it's a language selection/auto-redirecting landing page. But this requires that you create a default landing page. If you don't want to do this, you could set the default as English and redirect to the English site if the detected language is anything other than English or Polish. Some websites choose the former, while others choose the latter. Either way, Google is still going to serve the correct version in search results. – nburr Nov 10 '15 at 15:44
  • 2
    Thanks @JohnMueller - worth nothing that Google isn't the only search engine and others may still pay attention to it ;) – Andrew Lott Nov 10 '15 at 22:48
  • 2
    @AndrewLott good point -- Bing seems to use them: blogs.bing.com/webmaster/2011/03/01/… (or at least did in 2011). – John Mueller Nov 11 '15 at 22:46

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.