HTTP Status code for language redirect

后端 未结 5 1722
青春惊慌失措
青春惊慌失措 2020-12-25 13:43

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

5条回答
  •  我在风中等你
    2020-12-25 14:19

    I think the questions is more related what you want to achieve:

    1: Your index page should be the landing page for your visitor, and you want that page the be indexed by search engines.

    Pros: You have one entry page for all your visitors that can host additional information before the actual landing page. However, it will not have content for a specific language.

    Cons: You don't have any content pages for all languages on search engines.

    2: The actual translated page should be the landing page, and if possible your visitors should end up at the translated page directly if that is possible. The redirect page is only for visitors that ended up straight at your site by entering hostname in the addressbar.

    Pros: You have multiple "landing pages" for each individual language, which helps scoring and clickthrough.

    Cons: You don't have a generic landing page.

    There are more pros and cons on these two choices, but I can't think of it right now.

    If option 1: use a 302 because you still want it to be part of search index. if option 2: use a 301 because you don't want that page to be indexed. Alternatively, use a noindex on the language select page.

    Afaik, Google only takes into account, 301, 302 and 307 (temporary maintenance), and I think it consider everything else as 302 (seems most logical). As far as the browser goes, I think it doesn't matter. It might affect caching, but I think nowadays they are pretty aggressive in caching even 3xx responses.

提交回复
热议问题