While auditing my new static site Online Height Calculator (6,300+ pages in 9 languages built with Astro), I noticed 888 pages stuck in "Page with redirect" in Google Search Console.

The Root Cause:

Astro generated directory index files (dist/height-calculator/index.html), while my canonicals and sitemaps used clean URLs without trailing slashes (/height-calculator). On Cloudflare Pages, requesting /height-calculator triggers a 308 Permanent Redirect to /height-calculator/, creating a canonical mismatch.

The Fix (Zero Config Rewrite Needed):

Instead of refactoring all canonicals, sitemaps, and 70+ tests to trailingSlash: 'always', I added a small post-build Node script (generate-clean-urls.mjs) that hardlinks dist/path/index.html to dist/path.html in ~3 seconds.

The Result:

Cloudflare Pages now serves https://onlineheightcalculator.com/height-calculator (and our visual height comparison tool) directly with 200 OK and 0 redirects — matching our sitemaps and canonicals cleanly!