I have a question though.. you mention the use of rel canonical to solve the lesser second half of the problem.. What is that second problem? Shouldn't just the redirects be enough?
Btw, I have grown to prefer netlify.toml over the _redirects, etc. cookie files; esp. for CSP rules.
> I encountered that with Netlify's deploy previews (which it can be set to generate for pull requests or with draft builds)
Hmm, OK. So far, I haven't encountered duplicate pages. Netlify has an inbuilt env var $DEPLOY_PRIME_URL (e.g. it would be https://BR--SITE.netlify.com for a BR branch) [and similar for deploy previews]. I use that as BaseURL in #gohugo. So the page URLs are branches vs deploy previews vs production build are unique..
That said, I'll watch out for issues with just 301's.
This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!
We adhere to an adapted version of the TootCat Code of Conduct and follow the Toot Café list of blocked instances. Ash is the admin and is supported by Fuzzface, Brian!, and Daniel Glus as moderators.
Hosting costs are largely covered by our generous supporters on Patreon – thanks for all the help!