export default { async fetch(request) { const url = new URL(request.url); // We decode the pathname to handle %20 (spaces) correctly const decodedPathname = decodeURIComponent(url.pathname); // Define the two exact paths you want to redirect const sourcePath1 = "/Mobilising Silent Majorities March 2026 (2).pdf"; const sourcePath2 = "/Mobilising Silent Majorities March-24-2026.pdf"; const destinationURL = "https://majorities.climatemajorityproject.com/Mobilising%20Silent%20Majorities%20March%202026%20(2).pdf"; // If the request matches either of your two source files, redirect them if (decodedPathname === sourcePath1 || decodedPathname === sourcePath2) { return Response.redirect(destinationURL, 301); } // Fallback: If it's any other file on assets.climatemajorityproject.com, let it pass through normally return fetch(request); } };