I wonder which HTTP Status code I should have to send in language redirects.
I have the following php code to redirect via HTTP headers to most important language in
You could serve every language under the same url and then use content-negotiation of the Accept-Language
header, but I wouldn't recommend that.
I would rather suggest that on your web sites root url, you issue a redirect (303 - See Other) to a language sub page (E.g. /en
). When you do that, respond with a Vary
header, that specifies Accept-Language
(And any other relevant headers, such as Cookie
). That way, any intermediaries (proxies, caches) will be able to cache the response. I would specifically not issue a 301, since you still want links to point to the root url. On the language-specific page, I would put a rel="canonical"
to the root url.
See also these threads: