Mobile app version of vmapp.org
Login or Join
Martha676

: Proper status code for language redirection (301, 302, … 307)? I have build a websites with multiple languages. The URLs look like: http://www.example.com/en/ http://www.example.com/de/ If the

@Martha676

Posted in: #Http #Multilingual #Redirects #Seo

I have build a websites with multiple languages. The URLs look like:

www.example.com/en/ http://www.example.com/de/


If the user access the main domain www.example.com/ the web server detects the user's language (Accept-Language header) and redirects him to one of the above URLs.

Until now we have used a Temporary Redirect (302), because the user can return with other language settings and should then be redirected to the other one.

On another question, which advises to use 307:


307 Temporary Redirect

In this case, the request should be repeated with another URI;
however, future requests should still use the original URI. In
contrast to how 302 was historically implemented, the request method
is not allowed to be changed when reissuing the original request. For
instance, a POST request should be repeated using another POST
request.


The question is: what is the proper status code for language redirection?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Martha676

1 Comments

Sorted by latest first Latest Oldest Best

 

@Samaraweera270

The problem with automatic redirection based on the user's language is that it could prevent users and search engines from viewing all the versions of your site.

The best approach is to cross link each language version of a page, so the user can reach the desired language with a language selector easily, and search engines won't get confused (besides many having locale-aware crawling, it is still recommended).

For example, if you have Spanish (es) and English (en) pages, then you can specify their proper urls with rel="alternate" hreflang="x" link tag for itself in addition to links to the Spanish and English versions

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme