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.
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.
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.
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.