4

I have a multilingual website (English / Hungarian). I need to redirect my domain (mysite.hu) to subdirectories (/hu, /en), based on chosen user language preference (the default is Hungarian). For example:

Sometimes my 301 redirection looks like this:

user types: mysite.hu ---> redirected to --> mysite.hu/hu

and sometimes it looks like this:

user types: mysite.hu ---> redirected to --> mysite.hu/en

(the domain - mysite.hu - never used in standalone, redirection is automatically applied every time)

I think it's very confusing in an SEO aspect because this way I 301 redirect my main page permanently to two different pages at the same time. Or this is the proper way to do this? What is the best way to do this in an SEO friendly way?

1

the most SEO friendly way to redirect

The most SEO friendly way is probably not to redirect at all - unless perhaps the user has already made a specific choice (during their session).

...they get the Hungarian site by default.

Search engines need to be able to crawl both versions - so they cannot be forced (defaulted) to one or the other.

You need to make sure you have implemented the appropriate HREFLANG tags so the search engines know about the different language versions. See Googles' help docs: https://support.google.com/webmasters/answer/189077?hl=en

I 301 redirect my main page permanently to two different pages at the same time.

This isn't a "permanent" redirect. Users can presumably change their mind (or a different user uses the same computer/browser) etc. So, if a user has already made a choice then a temporary (302, 303 or 307) would be more appropriate.

If a user follows a result in the SERPs for example.hu/en then they should not be redirected, even if their language preferences are set otherwise.


UPDATE: From comments, it would seem that:

  1. The current language redirect only occurs on the document root. ie. example.com/. Other URLs are not redirected.
  2. example.com/ and example.com/hu would otherwise contain the same content.
  3. The document root example.com/ is not considered a canonical URL (it doesn't appear in the sitemap).

From this I think a 302 (temporary) redirect is perfectly OK. I would a avoid a 301 (permanent) simply because you don't necessarily want users to cache the redirect.

  • 1.) "is probably not to redirect at all" Yes, but then I will get duplicates: the root domain and the preferred language subfolder (for ex: mysite.hu and mysite.hu/hu ) which is exactly the same by default. Duplicates aren't evil? :) 2.) They can crawl both English pages and Hungarian pages (language changer do-follow links are presented many places in my site) plus there is an XML sitemap with the full list of URLs/pages in different languages (language indicators included) – Catso Jan 29 at 18:03
  • 3.) yes, but when a user changes his mind (and language) there won't be a mysite.hu and any redirection. He will change from mysite.hu/hu to mysite.hu/en or back ( there is no redirection here ). Only if someone types in the root domain (mysite.hu) that can be redirected in 2 different languages, based on previous (cookie stored) preferences. If you have chosen English once, next time the root domain will redirect you to the English subfolder instantly. So basically the root domain doesn't exist, or at least can't be used – Catso Jan 29 at 18:03
  • But Maybe I just generated a problem, from where no problems to be found :) – Catso Jan 29 at 18:03
  • Ah, so you only redirect the document root, which would otherwise be a duplicate of /hu? And URLs of the form /foo/bar are not redirected, even if /hu/foo/bar might exist? (Consequently /foo/bar results in a 404, when /hu/foo/bar exists?) – MrWhite Jan 30 at 10:56
  • Yes, exactly. /foo/bar will give a ( helpful ) 404 page, even if /hu/foo/bar is exists. – Catso Jan 30 at 11:06

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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