mozilla / bedrock

Making mozilla.org awesome, one pebble at a time
https://www.mozilla.org
Mozilla Public License 2.0
1.18k stars 919 forks source link

Remove x-default references that redirect #15464

Open a-kyne opened 1 week ago

a-kyne commented 1 week ago

Description

The x-default value is intended for international landing pages. We are using it for the domain default page at [https://www.mozilla.org/]. <link rel="alternate" hreflang="x-default" href="[https://www.mozilla.org/]" <link rel="alternate" hreflang="ach" href="[https://www.mozilla.org/ach/]" title="Acholi"> <link rel="alternate" hreflang="ar" href="[https://www.mozilla.org/ar/]" title="عربي">...

However, we are also using it for (I believe) every single page on the site.

Steps to reproduce

Open a 'www.mozilla.org' website page (other than the default domain page). Look at the hreflang tags in the and find the x-default value. Check the response for the x-default URL.

Expected result

There should be either no x-default value, or a URL that returns a 200 OK server status code and an HTML document.

Since we do not currently have any international versions of content (e.g. simplified content that uses International English) other than the "Choose your language page" home page there should be no x-default value in our hreflang tags other than for [https://www.mozilla.org/].

Actual result

The x-default uses unlocalized URLs that do not return a 200 and an alternate HTML document. They redirect, using a 302 "Temporarily Moved" server status code. Because search engines do not use the Accept-Language header (they accept all languages), they always receive the default en-US version of the page.

Example: <link rel="canonical" href="[https://www.mozilla.org/fr/firefox/features/free-pdf-editor/]"> <link rel="alternate" hreflang="x-default" href="[https://www.mozilla.org/firefox/features/free-pdf-editor/]"> <link rel="alternate" hreflang="fr" href="[https://www.mozilla.org/fr/firefox/features/free-pdf-editor/]" title="Français">

a-kyne commented 18 hours ago

This issue is a little more urgent that I first thought, because it might be the cause of the loss of traffic to the FR "PDF Editor" pages: those are the only pages that are available only in FR and not in en-US.

stevejalim commented 17 hours ago

@a-kyne My hot take is that the quickest fix is to ONLY include link entry with hreflang="x-default" on the locale-specific root page of www.m.o - eg only only www.mozilla.org/en-US/, www.mozilla.org/fr/ etc -- does that sound appropriate to you? If so I can do that soonish

slightlyoffbeat commented 16 hours ago

@pmac does this simple solution sound good to you? I confirmed with @a-kyne that this works for her. If so, lets move forward.

pmac commented 13 hours ago

Good with me. :shipit:

slightlyoffbeat commented 11 hours ago

@stevejalim its a thumbs up from all of us if you are good to do this.

stevejalim commented 11 hours ago

Sure thing. Here's the checklist I'll be working to, based on some DMs i had with @a-kyne