Hello,
I don't know if it is really related to Next International, because I've given a quick look in its source code and found 0 occurrence of canonical.
Unfortunately, I have a super weird issue with OpenGraph.
Let's say I have a page which exists in English https://dashboard-rtm.vercel.app/en/blog/patch-notes/dashboard/post-11, but not in any other language, and not in the default language too.
If I go to the Facebook Sharing Debugger, and then force a scrape of my page, then, I see that the canonical is forced to https://dashboard-rtm.vercel.app/blog/patch-notes/dashboard/post-11.
This is super weird, because I've set the canonical within the generateMetadata function, using App Router, respecting all the Next.js standards and using the latest version of Next, which is currently v14.2.3.
Also, I'm using urlMappingStrategy: 'rewriteDefault'.
So... I don't know what's going on.
Everything seems to be set perfectly fine in my <head> tag.
There is no https://dashboard-rtm.vercel.app/blog/patch-notes/dashboard/post-11 canonical.
Weird too, if I go to the Pagespeed Insights and put https://dashboard-rtm.vercel.app/blog/patch-notes/dashboard/post-11, then it will redirect properly, detecting a connection from USA.
I have no clue. :(
Is this likely to be coming from Next International, even if I don't think so?
EDIT: setting an explicit og:url does not change anything
EDIT 2: hmmm...
I've never set a canonical on a page which has two translations like this.
Weird.
Also, I do not understand the 307 HTTP Redirect.
It looks like the real issue is this redirect, which may be the root cause of all of this, leading Facebook's debug tool to infer the canonical based on the content after this redirection.
Maybe the middleware should NOT redirect when a request comes from services such as Pagespeed Insights or OpenGraph?
(Using something like this: https://github.com/omrilotan/isbot)
Also, I'm looking forward to test the v2.
I just would like to have an opinion about all of this: is it due to Next International or not, if so, why, how, and can we hope this to be fixed or shall we workaround it on the app side?
Hmm... Yes, after some other tests, it seems that the middleware always redirect the OpenGraph crawler to the default locale. I'll keep that in mind while waiting for the v2.
Hello, I don't know if it is really related to Next International, because I've given a quick look in its source code and found 0 occurrence of
canonical
.Unfortunately, I have a super weird issue with OpenGraph. Let's say I have a page which exists in English
https://dashboard-rtm.vercel.app/en/blog/patch-notes/dashboard/post-11
, but not in any other language, and not in the default language too.If I go to the Facebook Sharing Debugger, and then force a scrape of my page, then, I see that the canonical is forced to
https://dashboard-rtm.vercel.app/blog/patch-notes/dashboard/post-11
.This is super weird, because I've set the canonical within the
generateMetadata
function, using App Router, respecting all the Next.js standards and using the latest version of Next, which is currently v14.2.3. Also, I'm usingurlMappingStrategy: 'rewriteDefault'
.So... I don't know what's going on. Everything seems to be set perfectly fine in my
<head>
tag.There is no
https://dashboard-rtm.vercel.app/blog/patch-notes/dashboard/post-11
canonical.https://dashboard-rtm.vercel.app/en/blog/patch-notes/dashboard/post-11
Weird too, if I go to the Pagespeed Insights and put
https://dashboard-rtm.vercel.app/blog/patch-notes/dashboard/post-11
, then it will redirect properly, detecting a connection from USA.I have no clue. :( Is this likely to be coming from Next International, even if I don't think so?
EDIT: setting an explicit
og:url
does not change anythingEDIT 2: hmmm...![image](https://github.com/QuiiBz/next-international/assets/118654172/5d91a4c9-6939-472b-b97c-e6e8c9accce7)
I've never set a canonical on a page which has two translations like this. Weird.
Also, I do not understand the 307 HTTP Redirect. It looks like the real issue is this redirect, which may be the root cause of all of this, leading Facebook's debug tool to infer the canonical based on the content after this redirection.
URL: https://dashboard-rtm.vercel.app/en/blog/patch-notes/dashboard/post-06
Maybe the middleware should NOT redirect when a request comes from services such as Pagespeed Insights or OpenGraph? (Using something like this: https://github.com/omrilotan/isbot)
Also, I'm looking forward to test the v2. I just would like to have an opinion about all of this: is it due to Next International or not, if so, why, how, and can we hope this to be fixed or shall we workaround it on the app side?