Subject: Redirect based on User-Agent

Hi there,

You’re absolutely right — Cloudflare’s Page Rules don’t currently support conditional logic based on user agents.

The best way to achieve this is with a Cloudflare Worker. You can inspect the User-Agent header and conditionally return a redirect like so:

addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
  const ua = request.headers.get("User-Agent") || ""
  if (ua.includes("MSIE 8.0")) {
    return Response.redirect("https://example.com/ie8-unsupported", 302)
  }
  return fetch(request)
}

Workers give you full control over the HTTP request and can do these kinds of custom behaviors at the edge.

Tools I’d use: Cloudflare Workers Dashboard, Logs, Workers Preview/Test

Let me know if you want help deploying this script!