Nasrin
Nasrin
CDCloudflare Developers
Created by Nasrin on 4/26/2025 in #workers-help
Worker URL redirect broken, and deletion of worker doesn't do anything?
I'm using a simple URL redirection script to go to another website, so it is easier to share. When on my main browser (Opera) It redirects to example.com, how ever, on other browsers, it properly redirects. Originally, when putting in the code, I did use https://www.example.com to test, but now, even when deleting that worker and making a new one (same name), it still redirects improperly. Even when deleted, it still redirects, even though it doesn't exist (on the site) anymore. Here is the code I used:
export default {
async fetch(request) {
const destinationURL = "https://www.example.com";
const statusCode = 301;
return Response.redirect(destinationURL, statusCode);
},
};
export default {
async fetch(request) {
const destinationURL = "https://www.example.com";
const statusCode = 301;
return Response.redirect(destinationURL, statusCode);
},
};
It's from Cloudflare's developer docs https://developers.cloudflare.com/workers/examples/redirect/ Edit: Opening a third browser and checking the URL while deleted does show it's deleted, how ever, in the original 2 browsers, they still redirect to example.com and my own website.
9 replies