2

I have two languages for my website. So, by default, English should be loaded as my default language. Hence, there is no page at the root of example.com, if the user visits example.com, he/she would be redirected to example.com/English (or another language if there is anything saved in the user's cookies), using an HTTP 302 Temporary Redirect.

My second language is Persian. I want to save the language selection of the user in a cookie. Hence, when the user visits example.com, I first check if there is any language cookie, if set, then permanent-redirect the user to the site based on the user's preferences. It might be example.com/English or example.com/Persian.

I wonder if there is any problem with HTTP Permanent Redirection if it is about to change the destination. Also, I don't know what are the SEO implications of such redirection. Because, as you know, permanent redirection is way more SEO-friendly and I'm looking for a way to employ that. What should I do?

  • 1
    Permanent redirects are only SEO friendly for content that changed URL. In this case temporary redirects are more appropriate because they are not cached by browsers like 301 redirects are. That would allow somebody to change their preferences and still get the right behavior. – Stephen Ostermiller Sep 27 '16 at 13:01
  • 1
    There is no such things as a "302 Permanent Redirect" as you state. Did you mean "301 Permanent" or "302 Temporary"? – Stephen Ostermiller Sep 27 '16 at 13:02
4

A 302 response code is a temporary redirect rather than a permanent redirect. This is also not the best solution to be using in this scenario and nor are language cookies either.

Example.com will 301 redirect to the /en page as this is the default page. A href=lang tag will then be set on /fa and any other language versions to specify to Google that these are the language equivalents of the English page.

Rather than using a cookie to save language selection and temporarily redirect them to example.com/language you should use the href=lang tag which lets Google determine which language the page should be set to based on the version of the website the user is visiting. For example if a users language is English and visits the /fa version of the web page this should be displayed in Iranian.

In terms of the impact from an SEO perspective this will tell Google that there are different versions of the web page and will allow it to be indexed in different language versions.

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.