问题原文
原帖链接 · Catso · CC BY-SA 4.0
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?
已采纳解答
原帖链接 · MrWhite · CC BY-SA 4.0
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:
- The current language redirect only occurs on the document root. ie.
example.com/. Other URLs are not redirected. example.com/andexample.com/huwould otherwise contain the same content.- 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
