Bulk Redirects using Cloudflare Workers not Working

async function handleRequest(request) {
let requestURL = new URL(request.url)
let path = requestURL.pathname.split(’/’)[1]
let location = redirectMap.get(path)
if (location) {
return Response.redirect(location, 301)
}
// If in map, return the original request
return fetch(request)
}
addEventListener(‘fetch’, async event => {
event.respondWith(handleRequest(event.request))
})
const externalHostname = ‘workers-tooling.cf’
const redirectMap = new Map([
[’/?author=’, ‘https://google.com’],
[’/?s=
’, ‘https://google.com’],
[’/search*’, ‘https://google.com’],
])