Tech
Cloudflare Worker redirect never runs, because static assets are served first
I wrote a www → apex redirect in my Worker's fetch handler. It was dead code from the moment I deployed it, and I didn't notice for weeks.
Matches if: your Cloudflare Worker isn't running; the fetch handler never fires; a redirect in Worker code doesn't work; console.log in a Worker produces nothing on real pages.
The symptom
The redirect logic is right there in the Worker. It's deployed. You can read it in the dashboard. And www.example.com/about serves the page instead of redirectin...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to