Skip to main content

One post tagged with "infrastructure"

View All Tags

Your Cloudflare Pages Redirect Is Probably Backwards

· 9 min read
Scott Havird
Engineer

Your Cloudflare Pages Redirect Is Probably Backwards

Here's a scenario that's more common than it should be: you set up a site on Cloudflare Pages, configure a redirect so that www points to your apex domain, and everything looks fine. Then six months later you check Google Search Console and your impressions are split across four different URL variants. Half your SEO equity is leaking because both www.yourdomain.com and yourdomain.com are being indexed as separate pages.

The culprit isn't your code. It's Cloudflare Pages silently redirecting your apex domain to www — the exact opposite of what you intended.

I ran into this on my own site and spent longer than I'd like to admit tracing it down. Here's exactly what happens and how to fix it permanently.