Documentation JavaScript Examples - Redirect All Requests to one URL Redirect requests from one URL to another. Can be helpful during maintenance or downtime. const destinationURL = "https://azion.com" const statusCode = 301 async function handleRequest(request) { return Response.redirect(destinationURL, statusCode) } addEventListener("fetch", async event => { event.respondWith(handleRequest(event.request)) }) Contributors
Documentation JavaScript Examples - Redirect All Requests to one URL Redirect requests from one URL to another. Can be helpful during maintenance or downtime. const destinationURL = "https://azion.com" const statusCode = 301 async function handleRequest(request) { return Response.redirect(destinationURL, statusCode) } addEventListener("fetch", async event => { event.respondWith(handleRequest(event.request)) })