๐—”๐˜€๐˜๐—ฟ๐—ผ + ๐—–๐—น๐—ผ๐˜‚๐—ฑ๐—ณ๐—น๐—ฎ๐—ฟ๐—ฒ ๐—ฃ๐—ฎ๐—ด๐—ฒ๐˜€: ๐Ÿฏ ๐——๐—ฒ๐—ฝ๐—น๐—ผ๐˜† ๐—•๐˜‚๐—ด๐˜€

I built a static Astro site on Cloudflare Pages. I hit three bugs. These bugs cost me hours. Use these tips to save your time.

Bug 1: Trailing Slashes I set trailingSlash to never. Cloudflare added slashes automatically. Google Search Console showed redirect errors. The canonical URL did not match the live URL. Fix: Set trailingSlash to always.

Bug 2: Redirect Files I used the _redirects file for a domain redirect. Cloudflare rejected the deploy. Absolute URLs no longer work in this file. Fix: Delete the _redirects file. Use Redirect Rules in the Cloudflare dashboard.

Bug 3: Stale Cache I changed how the site builds. Some pages showed 404 errors. Cloudflare kept old redirect paths. Fix: Push a new commit. This forces a full rebuild.

Lessons:

Source: https://dev.to/mikecube/astro-cloudflare-pages-3-deploy-bugs-youll-probably-hit-3e5o