I’m summarising these below for us to discuss and identify the root causes of the same, so they can be addressed:
a. We have noticed that the sites which have 1 language set, it will at times suddenly redirect the homepage to _site_group depending on the site.
b. We have noticed that for sites where there are 2 or more languages set, it will suddenly redirect to zh-cn as a default to load
With both of the above issues, we just had to do a new release, and then it will start working.
As you can appreciate, these issues are causing a lot of noise with the client, and we are keen to iron these out asap. Any inputs/insights into the resolution of these issues will be much appreciated.
Our team has managed to find a fix for all of the issues we faced after taking the sites live. They had to change a configuration for one of the Netlify plugins NEXT_DISABLE_NETLIFY_EDGE = true. So disabling this enabled all of the other issues to be resolved.
We have encountered another issue when setting NEXT_DISABLE_NETLIFY_EDGE = true. Any redirects set in the CMS is not getting picked up. We have to hardcode the redirects into the next.config.js file which is our temporary work around for it to work.
error page returning function crash error page instead of https://www.cimic.com.au/scsdc. Timeout was increased to 26 seconds on the main site and error still persist until we disable the Netlify Edge.
CSP missing from page
random redirect on homepage - we are not sure what is causing this or how to trigger it.
But redirects set in CMS is working.
Any idea on how to get all these working together?
We have set CSP in next.config.js, but none of these works. We have set CSP in the netlify.toml file and these does not work on ISR pages.
Redirect in next.config.js does not work for us too. Only works when we add them to the netlify.toml file. Redirects setup in Sitecore works when we are using next version 13.4.12 but when we go higher, it doesn’t work ie 13.4.16.
When we first go live with the sites,
For sites that only has 1 language, the hompage will at random redirect to site(sitename) and give a 404 error page because it does not exist. It will never go back to the proper homepage unless we trigger another deployment.
For sites that has 2 languages, the homepage will at random redirect to the other language instead of English. Same as the above, it will not go back to the English language unless we trigger another deployment.
We are not sure if there is a caching somewhere or settings that we miss out that is causing the above issues.
it appears that it’s your code handling the redirect? You have added a middleware that says redirect middleware start, so are you sure the redirect is not happening there? We don’t add any such redirect from our end.