HTTP status code 406 appropriate for "Content not available in your country"? If not, what's appropriate?

1k views Asked by At

I have a multilingual website. The content language is defined via the URL:

www.example.com/en_gb/content/right/here/

To make sure search engines understand that the content is also available in other languages, I make use of the alternate links in my page's <head/>:

<link href="http://www.example.com/en_au/content/right/here/" hreflang="en-AU" rel="alternate">
<link href="http://www.example.com/fr_be/content/right/here/" hreflang="fr-BE" rel="alternate">
<link href="http://www.example.com/nl_be/content/right/here/" hreflang="nl-BE" rel="alternate">
<link href="http://www.example.com/en_ca/content/right/here/" hreflang="en-CA" rel="alternate">
<link href="http://www.example.com/fr_ca/content/right/here/" hreflang="fr-CA" rel="alternate">

Now my question: What shall I do in case someone requests the page with a valid locale (a local that is usually supported by my website), but the current page is not available for that locale?

Currently I write to the page "This content is not available for your country" and respond with HTTP status code 404 Not Found to make sure search engines don't index this page.

Could I also make use of the HTTP status code 406 Not Acceptable to make sure search engines understand even better that this page is also available in other languages? Would that status code even be appropriate? If so, how would I respond with the alternate links while at the same time showing a page to my users? This is what the RFC says:

Unless it was a HEAD request, the response SHOULD include an entity containing a list of available entity characteristics and location(s) from which the user or user agent can choose the one most appropriate

Thanks!

1

There are 1 answers

0
Quentin On BEST ANSWER

You are using distinct URLs for each language, so a 404 would be the appropriate status code to use in this instance.

If the different language resources were all available at the same URL and you used the Accept-language request header to determine which one to send, and the client didn't accept any of the languages you had available, then 406 would be the right choice.