question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Locale-less URLs cause redirection to URL for ja/Japanese-localized article

See original GitHub issue

In my Chrome or Firefox, when I open https://developer.mozilla.org/docs/Web/MathML/Element/mover or other locale-less URL, I get re-directed to https://developer.mozilla.org/ja/docs/Web/MathML/Element/mover (the ja-localized version of the doc).

And that’s in spite of the request not having an request headers that indicate a preference for Japanese:

Accept-Language: en-US,en;q=0.5 (in Firefox)
Accept-Language: en-US,en;q=0.9 (in Chrome)

So is the development server maybe doing some kind of content negotiation based on a reverse lookup of my IP address?

It’s interesting that I don’t see this behavior in Safari. In Safari I get redirected to https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mover (en-US) as expected. Maybe that’s due to Safari having a simpler Accept-Language header?

Accept-Language: en-us (in Safari)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sideshowbarkercommented, Feb 3, 2021

Could it be related to #128 - as in: do you have a cookie set to indicate Japanese preference?

Indeed yes, thanks — I find now that there was a preferredlocale cookie set to ja in both Chrome and Firefox. After deleting that cookie, I get redirected to the en-US article as expected

1reaction
Ryuno-Kicommented, Feb 3, 2021

Could it be related to https://github.com/mdn/yari/issues/128 - as in: do you have a cookie set to indicate Japanese preference?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Ultimate Guide to Redirects: URL Redirections Explained
Website owners often set up redirects for pages that are broken, contain duplicated content, or were moved to new URLs.
Read more >
Redirections in HTTP - MDN Web Docs - Mozilla
URL redirection, also known as URL forwarding, is a technique to give more than one URL address to a page, a form, or...
Read more >
Redirects and Google Search | Documentation
Redirecting URLs is the practice of resolving an existing URL to a different one, effectively telling your visitors and Google Search that a ......
Read more >
How to Redirect a Domain and Understand Redirect Types
In this article, we'll learn what a URL redirect is, how to ... The same content found on two separate URLs causes duplicate...
Read more >
URL Redirects - Squarespace Help Center
If you're using our classic product editor, the URLs won't include /p/. Other domains. Use a 301 redirect if you have a URL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found