"noindex" in the multilingual redirect—does this work for everyone?

It’s been mentioned before but I haven’t found a resolution.

Google wasn’t indexing my site due to this. I manually asked Google to index the /en URL, and hopefully that ought to be enough to fix Google indexing.

So I’m wondering about whether this is wise to have in the root redirect. It silently breaks indexing in some situations. I’m probably going to have to add Cloudflare to my site so I can create a 301 redirect and avoid this issue altogether.

Is your issue similar to this ?

Thanks, no, it’s redirecting and serving correctly. I’m talking about the <meta name=robots content="noindex"> tag in a redirect response:

curl https://forkful.ai/
<!doctype html>
<html lang=de-DE>
    <link rel=canonical href=https://forkful.ai/en/>
    <meta name=robots content="noindex">
    <meta charset=utf-8>
    <meta http-equiv=refresh content="0; url=https://forkful.ai/en/">

But you know, looking at this, I see a couple other problems: The lang=de-DE (en is the default language). And the <title> getting set. Also the canonical—that’s wrong.

Huh! I’d say there are a lot of issues with this. If I have time, I’ll try to reproduce it with a fresh project and submit a ticket.

I just switched my DNS to Cloudflare so I can do an HTTP 301 to /en. So this response won’t be like this for long.

1 Like

According to https://developers.google.com/search/docs/crawling-indexing/301-redirects#metarefresh Hugos redirects are not optimal but should work well enough.

I use them on a number of multilang sites without issues.

The “lang” attribute is wrong as you point out. Do you have “weight” set on your languages in the conf file? If you set “weight=1” on English it will correct itself I think.

The “canonical” look correct to me, it instruct that this page has a more proper version at another address. See https://developers.google.com/search/docs/crawling-indexing/canonicalization

No, I actually have de at weight 1 and en at weight 2. And I also have:

defaultContentLanguage: en

Why would you give higher precedence to the non-default language de ?

Switch so you have weight 1 on “en” instead and it should work.

For display purposes: Languages are typically listed in order of their two-letter codes. My site’s home page:

Ouch. B-b-but defaultContentLanguage: en!

FYI, everyone: Cloudflare has a free account level which includes creating redirects. So my site now returns 301 for //en/ without even hitting GitHub Pages.